WordPress.org

Ready to get started?Download WordPress

Forums

Page-list
subpages doesn't work all the time (2 posts)

  1. bristweb
    Member
    Posted 1 year ago #

    sometimes i want to use the subpages shortcode outside the loop. when i do this, $post->id will return empty. this causes the pagelist to show every single page of the site. :( the correction is simple

    instead of global $post, put global $wp_query

    and instead of 'child_of' => post->ID
    change it to: 'child_of' => $wp_query->post->ID

    http://wordpress.org/extend/plugins/page-list/

  2. webvitaly
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for your feedback.
    I have one more question.

    Should I change everywhere in the plugin's code?

    • this global $post to global $wp_query
    • this post->ID to $wp_query->post->ID
    • this post->post_parent to $wp_query->post->post_parent

    Or I should change it only in one place (for [subpages] shortcode only)?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.