[Resolved] Posts, and Post length, and filters

Home Forums Support [Resolved] Posts, and Post length, and filters

Home Forums Support Posts, and Post length, and filters

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #973108
    Sharon

    1. I would like to have my post on the blog page show alphabetically by title. How do I do that?
    2. I would like to put in a filter for only related blogs to show on the sidebar as opposed to recent posts. How do I do that?
    3. When I add the sidebar, the text of my blog gets squeezed so there is too much white space other either side of the pages. I tried adjusting the container but it does spread out the text. How can I utilize more of the page so it there is less white space on the left side of my posts?

    Thanks for your assistance

    #973202
    David
    Staff
    Customer Support

    Hi there,

    1. You can add this PHP snippet to order posts alphabetically:

    function db_abc_modify_query_order( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'orderby', 'title' );
            $query->set( 'order', 'ASC' );
        }
    }
    add_action( 'pre_get_posts', 'db_abc_modify_query_order' );

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

    2. You would need to use a related posts plugin – this article provides some of the more common ones:

    https://www.wpbeginner.com/plugins/5-best-related-posts-plugins-for-wordpress/

    Something to be mindful of is that these plugins can add a lot overhead to your server, so can make your site run slower when you have a lot of posts.

    3. Could you activate the sidebar so i can take a look at what the problem is?

    #973507
    Sharon

    Yes I have activate the side bar in the industries, here: https://nir-for-food.com/seafood/

    #973522
    David
    Staff
    Customer Support

    Aah ok – that Site uses a Layout Element to narrow the width of the single post. Go to Appearance > Elements and look for the Layout assigned to the Posts. Edit that and go to the Content tab where you can change the container width.

    #974720
    Sharon

    This suggestions you offered work great. Thank you so much. It was just what I needed.

    #974852
    David
    Staff
    Customer Support

    Glad to be of help

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