You can edit the post and in the meta box at the bottom select “Do not display”
@ajay – I’ve tried this both on the page and via the settings page to exclude from Pages (type), and by ID number, and it still displays. Is this a known bug?
Not that I am aware of. It works in all my tests. Have you cleared the cache if this was enabled?
I think I sourced the issue:
The echo_ald_crp function was being called manually from functions.php in the theme. This may have been because CRP is not (and likely was not at the time of theme authoring) displaying on “single-post” post types. CRP may have also had less placement options in the available settings at that time as well. Since the theme is a child theme of a framework, it may have been the decision that calling it in functions.php may have been cleaner in regards to ease of updating the child theme/parent theme set.
Was there a decision to make the default action be to not include CRP on single-post pages?
I have a feeling it’s theme specific changes that were done.
By default CRP displays on all single posts, pages or post types.
The plugin has always used is_single which applies to all post types except pages.
Is there anything in your functions.php that removes the actions that CRP adds to automatically add content? It could be because they wanted to style it in a particular way and hence disabled the action.
Side note: I’m quite happy to hear that there are themes that integrate my plugin 🙂
Its built on the genesis framework, and I’m not seeing anything in the child theme that would be altering the post_type at the first glance. CRP is looking on the page for a specific class in the body tag, or is querying the database?
Can you post what code is being used?
CRP queries the database:
This is the code behind CRP for the exclusion if you’ve selected the post from the Metabox to be excluded: https://github.com/WebberZone/contextual-related-posts/blob/master/includes/modules/exclusions.php
This is when entered from the settings page: https://github.com/WebberZone/contextual-related-posts/blob/master/includes/main-query.php#L427
A good way to debug is to install Query Monitor plugin and browse to a post on your blog where you are seeing these posts not being excluded and check what query is generated by the plugin
- This reply was modified 4 years, 1 month ago by Ajay.
Hope this wasn’t keeping you up at night… Commenting the code better would’ve helped here – thanks for nothing, past me!
If you want to see it in this particular use (with some custom css), check http://blog.brettmatthews.com/
functions.php is a theme thing not a plugin thing.
So, rather confused as to what you were trying to implement and how. But, glad you got that to work fine.
If I’m remembering correctly: neither the plugin’s positioning method nor the standard positioning method of items in WordPress (using 1-15 or whatever it is) was accurate enough to insert the plugin exactly where I wanted it, so I manually called and placed it inside the block I needed via functions.php. CRP really is a pretty slick little plugin though, so thanks for all your work on it!
- The topic ‘How to Disable In Custom Pages ?’ is closed to new replies.