Support » Plugin: Ultimate Posts Widget » hide current post

  • Terry Atkinson

    (@terry-atkinson)


    I love this plugin. There was one thing I wanted – to be able to hid the current post from the sidebar. There’s a thread on this support forum about this which was closed with no solution. I’ve found a solution that is OK for me as I don’t use a sidebar on the home page. So what I do is to make any post that I don’t want to appear in a given sidebar a sticky post. Then I click hide sticky posts in the widget filter. A bit of a gash workaround but does the job for me. Maybe will help someone else?

    https://wordpress.org/plugins/ultimate-posts-widget/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I agree, this plugin definitely needs the ability to hide the current post. It’s a basic feature for a “similar posts” widget.

    Without “Hide current” and the ability to offset I can’t use this. :/

    It would be fairly easy for the author to add this functionality and it would really make the plugin a lot better.

    If you don’t mind hacking the plugin, you could change the code in ultimate-posts-widget.php

    Add an extra array in the section starting at line 167.

    The full section looks like this:

    $args = array(
            'posts_per_page' => $number,
            'order' => $order,
            'orderby' => $orderby,
            'category__in' => $cats,
            'tag__in' => $tags,
            'post_type' => $types,
            'post__not_in' => array($post->ID)
          );
    • This reply was modified 4 years, 8 months ago by outofhouse.

    Awesome @outofhouse. It works.
    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘hide current post’ is closed to new replies.