[Resolved] Modifying a site library page

Home Forums Support [Resolved] Modifying a site library page

Home Forums Support Modifying a site library page

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #944329
    Nanette

    I am using the Merch site because it has the look I want but I don’t want the Woo Commerce. I like the blog page as it is, but want to change the menu name, images, and content but keep the formats of the post pages. I want to modify them all to my content and images. I assume this would be easy but I can’t see the blog page and my changes unless I preview the site to see the changes. If I go to pages and choose the Merch blog page in the dashboard, I don’t see anything. Why?

    #944670
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    The blog (posts page) is set in “Settings > Reading”. You’ll see it allows you to set your front page as a static page, or the posts page. If the front page is a static page, you can set your posts page (the blog) as another static page.

    Then, WordPress will automatically populate that static page with your posts (inside the “Posts” area of your Dashboard).

    If you want your blog to be your front page, you can set that option in “Settings > Reading”. Then you simply need to replace the posts in the “Posts” area with your own posts.

    Let me know if that helps or not πŸ™‚

    #945540
    Nanette

    Well to explain better, in the Merch site that I am modifying, I don’t want the blog page to be my front page, but I do want to modify it, and can’t seem to do it.

    I don’t want all the Posts just specific one I have categorized (industries) but can’t seem to figure out how to have my posts the way I want. In the blog page (renamed Industries) I want only the Posts categorized as Industries shown on the blog page. Then I want the posts categorized as Applications to be listed under specific blogs that fall under the category of Industries.
    Industries page list industry 1: industry 2: Industry 3:
    Posts categorized as applications are listed under the related industry, example:
    Industry 1 post page>application 1, application2

    I hope that helps

    #945641
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    It sounds like you need a plugin like this: https://wordpress.org/plugins/wp-show-posts/

    It allows you to create lists of posts specific to a category, and then display them on a static page.

    #946391
    Nanette

    I do have the free version from downloading the Merch site. But can’t seem to edit the blog page to work so it only pulls from a specific category. It is pulling all new posts into the static page. I believe it is using the WPshow post related but I can’t seem to have it pull only from one category, but it pulls in all new posts.

    #946571
    Leo
    Staff
    Customer Support

    If you want the default WordPress posts page to show one category only, you can use this PHP snippet:
    https://generatepress.com/forums/topic/multiple-static-frontpage-selected-posts-on-frontpage/#post-157558

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

    Let me know πŸ™‚

    #958641
    Nanette

    Hi Leo,

    So I downloaded code snippets and got the PHP Snippet and changed modified it so it isn’t home but the name of my post page which is Industries (My Post page name) As shown below:

    function generate_Industries_category( $query ) {
    if ( $query->is_Industries() && $query->is_main_query() ) {
    $query->set( ‘category_Industries’, ‘home-industries-slug’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘generate_Industries_category’ );

    But it still pulls all categories.

    #958760
    Leo
    Staff
    Customer Support

    Can you try this snippet with Tom’s instruction instead?
    https://generatepress.com/forums/topic/how-to-display-post-category-archive-as-home-page/#post-877735

    I tested the code and it should work.

    Let me know πŸ™‚

    #958826
    Nanette

    Hi Leo,

    That worked like a charm. Thank you so much.

    #958827
    Leo
    Staff
    Customer Support

    No problem πŸ™‚

    #1041861
    Nanette

    Hi Leo,

    I made a mistake of changing the categories of my industries page and after correcting it the industries page is now pulling posts I don’t want. The PHP snippet isn’t working any longer on the industries page. It should only show 7 posts categorized as industries but not it is pulling them all posts on the page and the PHP snippet isn’t working. How do I get it to work again.

    https://nir-for-food.com/industries/
    this is the snippet I used
    function generate_Industries_category( $query ) {
    if ( $query->is_Industries() && $query->is_main_query() ) {
    $query->set( ‘category_Industries’, ‘home-industries-slug’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘generate_Industries_category’ );

    I used an exclusion PHP snippet for the application category and another for the overview category but it only seems to work for the overview not for the application those PHP snippets are:
    to exlude application post
    function exclude_Applications( $query ) {
    if ( $query->is_Home() && $query->is_main_query() ) {
    $query->set( ‘cat’, ‘-26’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘exclude_Applications’ );

    To exclude Overview posts
    function exclude_Overview( $query ) {
    if ( $query->is_Home() && $query->is_main_query() ) {
    $query->set( ‘cat’, ‘-46’ );
    }
    }
    add_action( ‘pre_get_posts’, ‘exclude_Overview’ );

    The PHP Snippet has priority numbers can they all have priority 1 or does that conflict?

    #1042602
    Tom
    Lead Developer
    Lead Developer

    I don’t believe $query->is_Industries() is actually a function unless you’ve built a custom one?

    The code Leo linked to (https://generatepress.com/forums/topic/how-to-display-post-category-archive-as-home-page/#post-877735) makes it so your home page displays posts from a category.

    What are you wanting to do on the Industries page, exactly?

    #1060060
    Nanette

    I am trying to make it alphabetical and only show one category which is Industries. And I did not build a custom one.

    #1060828
    Tom
    Lead Developer
    Lead Developer

    So right now, your category page is here: https://nir-for-food.com/category/industries/

    The page you linked to looks like the main blog page, which will show all of your posts. Do you want your main blog page to only show industries? What about the other posts?

    #1060848
    Nanette

    Yes, that page should show only Industry category. I have posts that display each category
    So like the home post page they will show only Applications, Overview, or Industry.
    On the home page the menu breaks them out that way, but when you click on Industry https://nir-for-food.com/industries/ you get everything not just industries.

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