WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Title and Description not showing on pages using a custom template page (4 posts)

  1. x.ray
    Member
    Posted 2 years ago #

    Hi,

    My site uses a custom page template, which among others lists posts from specific categories.

    I would like to display the respective category titles and descriptions on the pages which use this page template.

    Here's a snippet of the code used in the page template:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    Is there any way for WordPress SEO to get the category for each page using this template, to use it to build titles and descriptions?

    Cheers

  2. strider27
    Member
    Posted 2 years ago #

    I'm also getting the same problem on my Testimonial page and also due to that, the Testimonial Widget is causing a wrong display of title and description of my Homepage.

  3. Jaja..
    Member
    Posted 2 years ago #

    Problem solved for me..

    (wasn't the same problem as above)

  4. x.ray
    Member
    Posted 2 years ago #

    Problem not solved for me (is the same problem as above ;-))

    Here's the snippet of the code used in the page template:

    get_header();
    $catId = gp_get_category_by_slug($wp_query->query_vars['catname']);
    $catName = $wp_query->query_vars['catname'];
    ?>
     <div id="main_content">
     <!-- Start the Loop. -->
     <?php
    	$includeArray = array(
    		$catId
    	);
    	query_posts(array('category__in' => $includeArray, 'posts_per_page' => 10, 'paged' => $paged));
    	if ( have_posts() ) : while ( have_posts() ) : the_post();
    	$thumb_url = '';

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic