WordPress.org

Ready to get started?Download WordPress

Forums

Flexi Pages Widget
[resolved] Flexi pages and query_posts (1 post)

  1. effex100
    Member
    Posted 3 years ago #

    This took me a little while to figure out so I figured I would share. I had a page template that used query_posts() to show a list of posts. I did this because I wanted Flexi Pages to show up and using a category on the menu didn't achieve this.

    Problem is query_posts masses with the page info FlexiPages uses and it wasn't showing up. After a bit I figured out this solution.

    before your query_posts() add this code
    <?php $temp_post = clone $post; ?>

    Then after your done but before the FlexiPages widget, switch it back.
    <?php $post = clone $temp_post; ?>

    This seems to preserve the page information the widget needs to function. This is effectively the same as the process for having multiple loops outlined here but for whatever reason swapping out wp_query didn't work. If any WP gurus want to chime in with why that is that would be cool. Otherwise I'm just hoping this info will help someone out.

    http://wordpress.org/extend/plugins/flexi-pages-widget/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.