• Resolved awelsh

    (@awelsh)


    I just updated to 1.3.0 and saw the new feature for excluding the current page. I was just beginning to look into how I could do this, so the update is very timely.

    Now I’m not sure if it is me or there is a problem with the plugin. I have a custom post type for products. And I’m using the following code in a widget to display the thumnail for those pages in my sidebar:

    [loop type=”book” count=”3″ offset=”0″ exclude=”this”]
    <div class=”sidebar-book-thumnail-box”>
    <div class=”sidebar-book-thumnail”>
    [field image-link image_class=”image-shadow”]
    </div>
    </div>
    [/loop]

    The problem is, the thumnail is not excluded when I’m on its page. If I put the page id in however, it does get excluded. Now the strange thing is, if I also add the following code to the actualy product page as well as keep the code in the sidbar widget, it is excluded:

    [loop type=”book” exclude=”this”]
    [/loop]

    Is this how this feature is to be used?

    Thanks,
    Adrian

    https://www.ads-software.com/plugins/custom-content-shortcode/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    I tried to improve this in the latest update, to make sure exclude=”this” will target the original post ID in which the loop is contained.

    Just to confirm, are you using the above code inside a book post type?

    Thread Starter awelsh

    (@awelsh)

    Thanks for the fix. Works great now. I’m using the code in my sidebar so it doesn’t originate in the post, but ends up there when wordpress does its thing. The post is a custom post type which I’ve named book.

    Thread Starter awelsh

    (@awelsh)

    Is it possible to use the exclude=”this” with just the following code?

    [content type=”post” id=”1376″ field=”image-link” image_class=”image-shadow” size=”full” exclude=”this” ]

    It is not being called from a [loop][/loop] anymore. I changed the way products are organized in my custom post type, and can’t use the loop I was using before. I’m wanting to display the image of indiviual posts (hence the id number) but exclude them when on their own page.

    Plugin Author Eliot Akira

    (@miyarakira)

    That makes sense – I added it in the latest update, so exclude=”this” works with [content] also.

    Thread Starter awelsh

    (@awelsh)

    Thank you so much! Your plugin is so useful and has made my life a lot easier. From what I can see, it is missing just one feature, which I know others have requested, and that is showing all posts with pagination. At the momement I’m using W4 Post Lists to achieve this, but if your plugin had pagination (especailly with ajax) that would be the only plugin I would need to manage my posts. I understand however you are proving this plugin for free, and I’m sure it must take up quite a bit of your time, so there is no pressure to add this feature.

    Regards,
    Adrian

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Exclude="this"’ is closed to new replies.