[Support request] Issues with Generatepress theme

Home Forums Support [Support request] Issues with Generatepress theme

Home Forums Support Issues with Generatepress theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #891063
    James

    1. There is only an option to display recent “posts” or a static page. I don’t produce posts for SEO, all my articles are individual pages. How do I essentially copy the “Display recent posts” but in form of pages? I tried “WP show posts” and changed the dropdown from “posts” to “pages” but this did not actually show anything after clearing cache.

    2. In my “recent posts” widget, it is showing the recent pages. This is what I want, but I obviously would like to exclude pages such as policy page and terms of conditions. How would I go about this?

    Many thanks,

    James

    #891160
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    1. WordPress itself doesn’t treat pages like posts. It seems like you might actually want to use posts if you’re using them in this way. However, we can try some PHP to force WordPress to include posts in your archives:

    add_action( 'pre_get_posts', function( $query ) {
        if ( is_admin() ) {
            return;
        }
    
        if ( $query->is_main_query() && ( is_home() || is_archive() ) ) {
            $query->set( 'post_type', array( 'post', 'page' ) );
        }
    
        return $query;
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    2. I’m not sure that’s something the recent posts widget can do. Maybe you’d be better off creating a menu for your pages in “Appearance > Menus” and then displaying it in a Menu widget?

    #891169
    James

    Hi Tom,

    Due to the nature of the site (Amazon affiliate site) It is going to be hosting evergreen content. Posts are for dynamic content with date/time. Therefor all my articles require to be hosted on a page. I am also siloing the content for SEO purposes. I will give your code a try tomorrow as it is late here. I appreciate the effort.

    I will also attempt to create a menu tomorrow and let you know how I get on.

    Thank you for the reply, please do not close this ticket unless I do not respond by tomorrow night. Thank you.

    Kind Regards,

    James.

    #891172
    Tom
    Lead Developer
    Lead Developer

    In that case, WP Show Posts should work better. You should be able to create a new list and set the post type to “Page”. Then you can add the list to a static page, and set that page as the front page.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.