Listing Page H1
This topic contains 10 replies, has 3 voices, and was last updated by VT 8 years, 5 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
November 14, 2016 at 11:39 pm #303751
Good afternoon!
We are seeing odd behavior where the H1 tag for listing pages is showing the title of the first post.
see: https://www.vegantravel.com/activities/
We would like the H1 here to say Vegan Activities, but it is showing the name of the first listing.
also see:
https://www.vegantravel.com/events/
https://www.vegantravel.com/accommodations/It also looks like it is happening with location “archive” pages:
https://www.vegantravel.com/dining/mexico/distrito-federal/ciudad-de-mexico/
https://www.vegantravel.com/dining/mexico/distrito-federal/
https://www.vegantravel.com/dining/mexico/any ideas?
Thanks!
November 14, 2016 at 11:40 pm #303755This reply has been marked as private.November 15, 2016 at 5:42 pm #304262Hi,
did you try deactivating all non GD plugins to see if one is overwriting the archive titles?
I would also try to update the theme and all plugins.
Let us know,
Thanks
November 15, 2016 at 10:42 pm #304471Sorry, I had updated everything on our development site and still saw the issues. I had not gotten around to updating the main site yet, so we could complete the testing on the dev site.
Anyway, Everything is updated now and I did turn off all other plugins on the dev site and still saw the issue.
November 15, 2016 at 10:44 pm #304473This reply has been marked as private.November 15, 2016 at 11:08 pm #304490The developers will let us know asap, they have been alerted.
Thanks
November 16, 2016 at 1:17 pm #304756I see all your 3rd party plugins are active. Could you disable non GD plugins till I debug this issue?
Thanks
November 16, 2016 at 1:40 pm #304789Your first listing title is displayed in the main title. We had this problem earlier. But we fixed that one.
Can you make sure you have updated everything including the GD templates you copied in your theme.?
Thanks
November 17, 2016 at 11:29 pm #305780I think found the issue within the functions.php file of our child theme. We have added the following code to change titles of category archive pages. When I remove the code, listing page titles works as expected.
I am not sure how to modify it prevent overwriting the Geodirectory listings page titles, but I suspect it is the last else line that outputs Get_the_title() ? Maybe?
Can you help me with the lines needed to be added? Please?
function kleo_title()
{
$output = “”;
if ( is_category() )
{
$output = __(”,’kleo_framework’).” “.single_cat_title(”,false);
}
elseif (is_day())
{
$output = __(‘Archive for date:’,’kleo_framework’).” “.get_the_time(‘F jS, Y’);
}
elseif (is_month())
{
$output = __(‘Archive for month:’,’kleo_framework’).” “.get_the_time(‘F, Y’);
}
elseif (is_year())
{
$output = __(‘Archive for year:’,’kleo_framework’).” “.get_the_time(‘Y’);
}
elseif (is_search())
{
global $wp_query;
if(!empty($wp_query->found_posts))
{
if($wp_query->found_posts > 1)
{
$output = $wp_query->found_posts .” “. __(‘search results for:’,’kleo_framework’).” “.esc_attr( get_search_query() );
}
else
{
$output = $wp_query->found_posts .” “. __(‘search result for:’,’kleo_framework’).” “.esc_attr( get_search_query() );
}
}
else
{
if(!empty($_GET[‘s’]))
{
$output = __(‘Search results for:’,’kleo_framework’).” “.esc_attr( get_search_query() );
}
else
{
$output = __(‘To search the site please enter a valid term’,’kleo_framework’);
}
}
}
elseif (is_author())
{
$curauth = (get_query_var(‘author_name’)) ? get_user_by(‘slug’, get_query_var(‘author_name’)) : get_userdata(get_query_var(‘author’));
$output = __(‘Author Archive’,’kleo_framework’).” “;if(isset($curauth->nickname)) $output .= __(‘for:’,’kleo_framework’).” “.$curauth->nickname;
}
elseif (is_tag())
{
$output = __(‘Tag Archive for:’,’kleo_framework’).” “.single_tag_title(”,false);
}
elseif(is_tax())
{
$term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) );
$output = __(”,’kleo_framework’).” “.$term->name;} elseif ( is_front_page() && !is_home() ) {
$output = get_the_title(get_option(‘page_on_front’));} elseif ( is_home() && !is_front_page() ) {
$output = get_the_title(get_option(‘page_for_posts’));} elseif ( is_404() ) {
$output = __(‘Error 404 – Page not found’,’kleo_framework’);
}
else {
$output = get_the_title();
}if (isset($_GET[‘paged’]) && !empty($_GET[‘paged’]))
{
$output .= ” (“.__(‘Page’,’kleo_framework’).” “.$_GET[‘paged’].”)”;
}
return $output;
}November 18, 2016 at 11:50 am #306035Try this code
function kleo_title() { $output = ""; if ( is_category() ) { $output = __('','kleo_framework')." ".single_cat_title('',false); } elseif (is_day()) { $output = __('Archive for date:','kleo_framework')." ".get_the_time('F jS, Y'); } elseif (is_month()) { $output = __('Archive for month:','kleo_framework')." ".get_the_time('F, Y'); } elseif (is_year()) { $output = __('Archive for year:','kleo_framework')." ".get_the_time('Y'); } elseif (is_search()) { global $wp_query; if(!empty($wp_query->found_posts)) { if($wp_query->found_posts > 1) { $output = $wp_query->found_posts ." ". __('search results for:','kleo_framework')." ".esc_attr( get_search_query() ); } else { $output = $wp_query->found_posts ." ". __('search result for:','kleo_framework')." ".esc_attr( get_search_query() ); } } else { if(!empty($_GET['s'])) { $output = __('Search results for:','kleo_framework')." ".esc_attr( get_search_query() ); } else { $output = __('To search the site please enter a valid term','kleo_framework'); } } } elseif (is_author()) { $curauth = (get_query_var('author_name')) ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author')); $output = __('Author Archive','kleo_framework')." "; if(isset($curauth->nickname)) $output .= __('for:','kleo_framework')." ".$curauth->nickname; } elseif (is_tag()) { $output = __('Tag Archive for:','kleo_framework')." ".single_tag_title('',false); } elseif(is_tax()) { $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); $output = __('','kleo_framework')." ".$term->name; } elseif ( is_front_page() && !is_home() ) { $output = get_the_title(get_option('page_on_front')); } elseif ( is_home() && !is_front_page() ) { $output = get_the_title(get_option('page_for_posts')); } elseif ( is_404() ) { $output = __('Error 404 - Page not found','kleo_framework'); } else { if (geodir_is_page('listing')) { ob_start(); // Start buffering; geodir_action_listings_title(); $title = ob_get_contents(); ob_end_clean(); $output = $title; } elseif (geodir_is_page('author')) { ob_start(); // Start buffering; geodir_action_author_page_title(); $title = ob_get_contents(); ob_end_clean(); $output = $title; } else { $output = get_the_title(); } } if (isset($_GET['paged']) && !empty($_GET['paged'])) { $output .= " (".__('Page','kleo_framework')." ".$_GET['paged'].")"; } return $output; }
November 18, 2016 at 6:08 pm #306267That worked! Thank you. 🙂
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket