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

    On this artist’s website, “Mary’s Blog” is the main blog page. We only want standard blog posts featured on her blog page with the categories: Creativity, Events, Mind Mush, News, and Personal. We are also creating image-format posts that feature her artwork, using the Categories of “Current Work” and “Previous Work” that we want featured on the Gallery page. We do not want these two categories to show up on her Mary’s Blog page. Using the Advanced Layout Editor, I’ve set the Blog Posts Content Element to allow all post categories except “Current Work” and “Previous Work”, yet these categories are still showing up on the Mary’s Blog page.

    What am I doing wrong?

    #1423778

    Hi phausner,

    The Blog Layout you are using is Blog Layout which means it uses a predefined layout, there are two options you can do.
    1. Switch to Use the advance layout editor to build your own blog layout (simply edit the page you have chosen in Enfold->Theme Options as a blog page) and you’ll have control over the Blog page.
    or:
    2. Simply add this code at the bottom of your child theme’s functions.php code:

    function exclude_category( $query ) {
      if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '-20, -21' );
            }
      }
    add_action( 'pre_get_posts', 'exclude_category' );

    Hope it helps.

    Best regards,
    Nikko

    #1423837

    Thank you, Nikko. I am already using the advanced layout editor for the blog page (Mary’s Blog) and have selected the blog categories that should appear on that page. However, all the categories are appearing, which is why I reached out to you for help.

    I added the code you provided to the Quick CSS box and it didn’t do anything. You did say to add the code to the bottom of my child theme’s functions.php code, but to be honest…I haven’t done anything like that in years and am not entirely sure where to find that file. I’m guessing it isn’t accessible through the WP Dashboard but instead I would need to login to my webhost and find that file in the HTTP directory? Is that correct?

    Obviously, I’d prefer it if I could resolve the issue through some other means (like, why is the advanced layout editor including categories that I didn’t select?) but if adding the code that you’ve generously provided is the best way, could you please confirm where I find the file that needs the code added?

    Thank you,

    #1423854

    Hi phausner,

    Yes, you are correct that the file is in the directory, however, the Theme Editor was not enabled on your site, so you can only access it via FTP or cPanel (through webhost).
    I opted for option #1, I posted above and made the changes, please review your website.

    Best regards,
    Nikko

    #1423932

    Thank you so much, Nikko!! You’re the best!!!

    #1423955

    Hi,

    Great, I’m glad that Nikko could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

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