Forums

[resolved] Duplicated posts from shortcode function (3 posts)

  1. ivyowl
    Member
    Posted 1 year ago #

    Hi all,

    first post here, hope someone can shed some light.

    I've set up an events listing based on Noel Tocks tutorial here.

    Basically using custom post types to input the data, then a function so i can call it through shortcode.

    I've set it up to just show the posts from specific catagories so i can show them in different places.

    It all works fine, except its duplicating the posts. I have 4 copies of 1 post, 5 of another, and then another 4 of the last post!

    Have had a look into multiple loops but as this is within a function i wasn't sure how to stop them from duplicated. Any help would be much apprecieated.

    Codes here:

    [code moderated as per forum rules - please use the pastebin]

    Thanks!!

  2. 123milliseconds
    Member
    Posted 1 year ago #

    Code still not posted again; I suspect you will need the following 'somewhere' in those loops

    Read in the meantime to better understand when someone here help you

    http://codex.wordpress.org/Function_Reference/wp_reset_query

  3. ivyowl
    Member
    Posted 1 year ago #

    Code is here now:

    http://pastebin.com/maxfQ9Df

Topic Closed

This topic has been closed to new replies.

About this Topic