Support » Themes and Templates » Mystique Page of Posts

  • millennialwave


    I’m trying to add a “page of posts” (short content at the top followed by the most recent posts) to the Mystique Theme. Specifically, I’d like to choose the “News” category of posts for this page.

    I’ve added a pageofposts.php into the wp-content/themes/mystique/directory. This file contains the following code found on

    Template Name: PageOfPosts adapted for "mystique" Theme by
    get_header(); ?>
       <!-- main content: primary + sidebar(s) -->
      <div id="main">
       <div id="main-inside" class="clear-block">
        <!-- primary content -->
        <div id="primary-content">
         <div class="blocks">
           <?php do_action('mystique_before_primary'); ?>
    if (is_page() ) {
    $category = get_post_meta($posts[0]->ID, 'category', true);
    if ($category) {
      $cat = get_cat_ID($category);
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
      $post_per_page = 4; // -1 shows all posts
      $do_not_show_stickies = 1; // 0 to show stickies
        'category__in' => array($cat),
        'orderby' => 'date',
        'order' => 'DESC',
        'paged' => $paged,
        'posts_per_page' => $post_per_page,
        'caller_get_posts' => $do_not_show_stickies
      $temp = $wp_query;  // assign orginal query to temp variable for later use
      $wp_query = null;
      $wp_query = new WP_Query($args); 
            if (have_posts()):
             while (have_posts()):
           <?php do_action('mystique_after_primary'); ?>
        <!-- /primary content -->
        <?php get_sidebar(); ?>
    	$wp_query = $temp;  //reset back to original query
    }  // if ($category)
      <!-- /main content -->
    <?php get_footer(); ?>

    This successfully enables the “PageOfPosts” template option for new pages. However after I select this template option for my “News” page, two things happen:
    1) my page sidebars disappear, and
    2) no posts tagged in the “News” category show up on the page. No posts show up at all.

    By the way, my custom field name is News and my custom field value is News.

    I’d appreciate your help because I bet there are some simple explanations and fixes.


Viewing 3 replies - 1 through 3 (of 3 total)
  • digitalnature


    why don’t you use the [query] shortcode instead?



    WOW. I totally just overlooked it. So simple; your theme rocks, by the way. Thanks for the ongoing support!

    Thanks so much!
    I’ve been trying to figure this out for days and just found out about this [query] shortcode!

    Thanks, and your theme rocks here too!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Mystique Page of Posts’ is closed to new replies.