Support » Plugin: Content Blocks (Custom Post Widget) » [Plugin: Custom Post Widget] Conflict w/other Plugins | Queries Duplicating

  • Resolved jonahcoyote


    Hi there, fantastic plugin first off and thank you! I ran into a conflict with Events Manager where the Events Manager content for a page was displaying where my Content Blocks were. Basically duplicating the content. I did post the issue in their forum but ended up solving the problem by modifying the query in your plugin. Here is what I did:

    Now, I’m not sure where the problem lies, I just know that this modification fixed it. It’s still querying like it was before but instead of using get_post() I’m using WP_Query() and passing in the appropriate variables just like you were.

    Maybe you can shed some light on this or maybe this can help others out there running into the same problem where queries are duplicating. I hope so.


Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Johan van der Wijk


    Hi Jonah,

    Thanks for sharing your code on pastebin. In the past I used get_posts to display the content blocks, but because this will include any added content such as social media sharing buttons I had to change this to get_post.

    Would you know how I can prevent other plugins from adding stuff to the content blocks using the code you provided?



    Hmmm not sure I understand fully. Don’t you want any content input in any content block to display? The ‘post_type=content_block’ parameter in the query will ensure that only Content Block post types will display… Can you give me a specific example?

    Plugin Author Johan van der Wijk


    Here you can see what happens: [link removed]

    On this page I am using your code for the post-widget.php page and as you can see the sharing buttons from the Share and Follow plugin are added to both the main post and the content block widget in the footer.

    I would like to know if there is a way to prevent the buttons from appearing in the content block widget by changing the get_posts query.

    I see… No, not that I know of. There’s a couple of ways around this though. Manually insert the share links via a different hook or different place in the template. Or, use something like to use custom excerpt excluding tags like ‘div’ which would exclude the share links from showing.

    I am having the same problem – the share buttons appear at the bottom of the widget. I replaced the code with jonah’s and that fixed it, but unfortunately, my breadcrumb trail shows the current page as the custom post widget title (hope that makes sense).

    I could not remove the share buttons using the advanced excerpt plugin either.

    Any ideas on how to remove the share buttons?

    Hi, Thanks for the great plugin!

    And I just want to add my vote that the duplicate content in the sidebar is still a problem for people trying to use Events Manager.

    I used Jonah’s code and it fixed the problem.

    Also, I followed this tutorial to add my social media and it doesn’t appear in the sidebar —

    Hi all,

    I am having the same conflict between the plugin Custom Post Widget and the Shopp plugin. Since this is exactly the same duplicate content in the sidebar issue that Waking Media and Jonah Coyote is having with the Events Manager, my suspicion is that it is caused by the Custom Post Widget plugin.

    I’m looking into the widget code. I’m suspecting the query code is wrong in the Custom Post Widget resulting in the query getting the Shopp products rather than the custom content of the widget post. Would be nice for the developer of the Custom Post Widget to re-examine their query code. The same issues occurs with the Widget Entries widget as well, which has the same functionality as the Custom Post Widget.

    The problem is the:

    echo do_shortcode($content);

    line in the Custom Post Widget. This conflicts with the do_shortcode in the Shopp plugin and probably in the Events Manager as well. So, instead of getting the shortcode defined in the Custom Posts Widget, the Shopp plugin or Events Manager plugin’s shortcode for the sidebar is used instead (not pretty).



    I experienced the same issue with All-in-One Event Calendar

    But I was able to fix it right away with jonahcoyote’s pastebin solution.

    Plugin Author Johan van der Wijk


    This issue should be fixed in the latest version of the Custom Post Widget plugin. You if you check the checkbox for ‘Do not apply content filters’ no addtional content will be added. It would be most helpful if you could let me know if this works for you.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: Custom Post Widget] Conflict w/other Plugins | Queries Duplicating’ is closed to new replies.