Exclude current post
  • paoloperlitipaoloperliti June 2011
    Posts: 1

    Great plugin, thank you for your precious work!

    I have a question for you.


    I installed the plugin(version 0.18.3) to include
    at the bottom of a post a list of 'similar' posts (that is, posts that
    have same category of the one currently showed).

    I used the following shortcode:


    [catlist id=XX numberposts=5]


    where XX=is the category of the current post (eg. 29).

    The result is the list of 'similar' posts, but that list includes the current one too.

    So I tried this one:


    [catlist id=XX numberposts=5 excludeposts=<ID_OF_CURRENT_POST>]


    but I don't know how to set the value <ID_OF_CURRENT_POST> at runtime.


    Any help is appreciated.


  • SevkaSevka August 2011
    Posts: 1
    Hey, had the same problem as you this morning.

    This is how i solved it:
    You will need to install+activate the plugin, which enables you to include php inside html.
    I used the following:
    PHP Execution 1.0.0 

    (it is like on the first page if you search for "php" in plugins)

    when this is done you can just include this code:

    [catlist id=(whatever) excludeposts=<?php the_ID(); ?>]

    <?php the_ID(); ?>
    is an id of the current post. 

    Hope this helped.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with OpenID Sign In with Twitter Sign In with Google

Sign In Apply for Membership

In this Discussion

This Site is currently in maintenance mode.
Please check back here later.
→ Site Settings