Support » Plugin: Page-list » subpages doesn't work all the time

  • 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

Viewing 1 replies (of 1 total)
  • Plugin Author webvitalii


    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)?

Viewing 1 replies (of 1 total)
  • The topic ‘subpages doesn't work all the time’ is closed to new replies.