• Hello,

    With Post Types “Pages” taxonomy appears in blank, is this normal?

    And, how to limit the showed pages to childpages or brother pages?

    thanks

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Support Elvin

    (@ejcabquina)

    Hi there,

    With Post Types “Pages” taxonomy appears in blank, is this normal?

    If no static pages are published, that would occur.

    But if there are a few, then there should be something within the list.

    I’ve tested it myself here and it seems to work as intended in this demo sandbox site.
    https://dev-generate-press.pantheonsite.io/wpsp-page/

    And, how to limit the showed pages to childpages or brother pages?

    The listing can be limited by setting the “Post per page” value. By default, it’s set to 10 as shown here – – but you can change it to your preference.
    https://share.getcloudapp.com/wbu9E1g6

    Thread Starter Suki

    (@sukinoz)

    Im sorry, I think I explained myself very badly. I will try again:

    First problem: If in the “post types” dropdown you choose “Pages”, the next option called “Taxonomies” did not disappear (instead it was a blank dropdown). This has been fixed by reinstalling the plugin. Now when you choose “pages” as “post types”, the “taxonomies” option disappears. OK. THIS IS FIXED.

    Second problem: If I choose “pages” in the “post types” option, how can I filter the results to show only the “childpages” of the page where the shortcode is inserted?

    I know that the pages do not have taxonomies, but they have as “page attributes” the “parent page”.

    Maybe it could be added the option to show only the pages that have as “parent page” a specific page?

    Thanks

    • This reply was modified 3 years, 8 months ago by Suki.
    Plugin Support Elvin

    (@ejcabquina)

    This is pretty tricky to do but this is doable with the most recent version of WPSP:
    https://wpshowposts.com/wp-show-posts-1-2-0/

    We can use the wp_show_posts_shortcode_args filter.

    add_filter( 'wp_show_posts_shortcode_args', function( $args, $settings ) {
     if(1821 === (int)$settings['list_id']){
        $args['post_type'] = 'page';
        $args['post_parent'] = 1814;
      }
      return $args;
    }, 15, 2 );

    1814 is the page ID of the parent page of the child pages you want to be displayed. Change it to the appropriate page ID you want child pages to be displayed.

    Thread Starter Suki

    (@sukinoz)

    Thanks, it works.

    Just dreaming… Would it possible to be added as options when “post type” = “page” is selected?

    For example:
    https://i.ibb.co/2k3ndCj/Captura-de-pantalla-2021-03-16-153045.png

    https://i.ibb.co/DD360HP/Captura-de-pantalla-2021-03-16-153234.png

    • This reply was modified 3 years, 8 months ago by Suki.
    • This reply was modified 3 years, 8 months ago by Suki.
    Plugin Support Elvin

    (@ejcabquina)

    Having that makes sense.

    I’ve raised an issue on the GitHub page. ??
    https://github.com/tomusborne/wp-show-posts/issues/34

    Glad it works for you. No problem. ??

    Thread Starter Suki

    (@sukinoz)

    great

    Plugin Support Elvin

    (@ejcabquina)

    We’re not exactly sure when that’ll be added in but you can check our changelog page from time to time to check for any recent updates. ??
    https://wpshowposts.com/category/development/

    Thread Starter Suki

    (@sukinoz)

    ok.

    I hope at least the wp_show_posts_shortcode_args filter and ‘post_parent’ arg will come in the next stable version soon

    Plugin Support Elvin

    (@ejcabquina)

    We’ll see what we can do about it. We’ll let you know. ??

    You can visit our changelog page from time to time to check for any updates. https://wpshowposts.com/category/development/

    I also have a question regarding pages. Would it be possible to show pages based on the value of a custom field instead of the Page ID of a parent page?

    Basically trying to have Categories like “Newest articles”, “Popular articles” on pages to show on home page with WPSP.

    Thanks

    Plugin Support Elvin

    (@ejcabquina)

    I also have a question regarding pages. Would it be possible to show pages based on the value of a custom field instead of the Page ID of a parent page?

    Basically trying to have Categories like “Newest articles”, “Popular articles” on pages to show on home page with WPSP.

    Thanks

    This is a WPSP Pro feature. The pro version allows you to select the category for the post list.

    Alternatively, you can try modifying the shortcode.

    Example:

    [wp_show_posts id="76440" settings="taxonomy=category&tax_term=humanities"]

    the settings attribute is basically telling WPSP that it should only show posts from the taxonomy “Category” with a category term/slug “humanities”.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Post Types Pages taxonomy or childpages’ is closed to new replies.