• Hi there,

    This is a twentyfourteen theme problem.

    I’m trying to get the ephemera Widget to display cute quotes (from posts) *without* those “Quotes posts” also showing up on the static blog page where other, regular “bloggy” posts appear.

    My current solution/idea has been to:

    1) Create a “Quotes” Category
    2) Place the quotes posts into that category only
    3) With child-domain custom function.php, exclude that category from appearing on the blog page.

    I have followed the instructions from here:

    https://www.locoed.com/web-design/how-to-exclude-category-posts-wordpress-tutorial-code/

    …and it actually works very well. Except that it works *too* well: it excludes that category from showing up within the Ephemera Widget as well! ??

    Please consider the PHP code below (yes, the xx is replaced for the category code):

    function exclude_category($query) {
    if ( $query->is_home() || ($query->is_archive() && !$query->is_category())) {
    $query->set('cat', '-xx');
    }
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');

    …and kindly tell me how I could create an exception that would allow for the Ephemera Widget *not* to block that category.

    Thanks!

Viewing 1 replies (of 1 total)
  • Thread Starter pbcconsulting

    (@pbcconsulting)

    Ah! One more thing I just noticed. It seems this code does not completely remove all “regular” traces of the hidden posts, as they still appear during the post navigation (“Next Post” // “Previous Post”)

    That should also be eliminated ??

    (How long will I be able to carry on without learning PHP? ?? )

    Thanks!

Viewing 1 replies (of 1 total)
  • The topic ‘Ephemera Widget: Quotes without blog posts’ is closed to new replies.