Support » Plugin: WP Post Nav » exclude certain pages when navigating pages
exclude certain pages when navigating pages
-
Hello, first of all thank you for this plugin. Great job. I use this plugin to switch between pages. Is it possible to exclude the pages I have specified from this navigation?
good work
-
I couldn’t see the difference between the first code and the second code you sent?
The post ids weren’t in an array format -> I added brackets around them
function wppostnav_exclude_pages($where) { global $wpdb; return $where . " AND p.ID IN ( SELECT p.ID FROM $wpdb->posts p LEFT JOIN $wpdb->postmeta m ON p.ID = m.post_id WHERE p.ID NOT IN!= ('742, 744')"; } add_filter ('get_next_post_where', 'wppostnav_exclude_pages', 999,1) ; add_filter ('get_previous_post_where', 'wppostnav_exclude_pages', 999,1);
I edited the code as above, this time it disappeared from all pages
The new function you’ve added isn’t correct
Please copy the below exactly as is
‘
function wppostnav_exclude_pages($where) {
global $wpdb;
return $where . ” AND p.ID IN (
SELECT p.ID FROM $wpdb->posts p
LEFT JOIN $wpdb->postmeta m ON p.ID = m.post_id
WHERE p.ID NOT IN (‘742, 744’))”;
}
add_filter (‘get_next_post_where’, ‘wppostnav_exclude_pages’, 999,1) ;
add_filter (‘get_previous_post_where’, ‘wppostnav_exclude_pages’, 999,1);
‘function wppostnav_exclude_pages($where) { global $wpdb; return $where . " AND p.ID IN ( SELECT p.ID FROM $wpdb->posts p LEFT JOIN $wpdb->postmeta m ON p.ID = m.post_id WHERE p.ID NOT IN ('742, 744'))"; } add_filter ('get_next_post_where', 'wppostnav_exclude_pages', 999,1) ; add_filter ('get_previous_post_where', 'wppostnav_exclude_pages', 999,1);
again i edited the code as above, this time it disappeared from all pages
-
This reply was modified 2 years ago by
petraagency.
@jo4nny8 >> package up the site <<
While I know you have the best of intentions, it’s forum policy that you not ask users for admin or server access. Users on the forums aren’t your customers, they’re your open source collaborators, and requesting that kind of access can put you and them at high risk.
If they are paying customers (such as people who bought a premium service/product from you) then by all means, direct them to your official customer support system. But in all other cases, you need to help them here on the forums.
Thankfully are other ways to get information you need:
- Ask the user to install the Health Check plugin and get the data that way.
- Ask for a link to the http://pastebin.com/ or https://gist.github.com log of the user’s web server error log.
- Ask the user to create and post a link to their
phpinfo();
output. - Walk the user through enabling WP_DEBUG and how to log that output to a file and how to share that file.
- Walk the user through basic troubleshooting steps such and disabling all other plugins, clear their cache and cookies and try again (the Health Check plugin can do this without impacting any site vistors).
- Ask the user for the step-by-step directions on how they can reproduce the problem.
You get the idea.
We know volunteer support is not easy, and this guideline can feel needlessly restrictive. It’s actually there to protect you as much as end users. Should their site be hacked or have any issues after you accessed it, you could be held legally liable for damages. In addition, it’s difficult for end users to know the difference between helpful developers and people with malicious intentions. Because of that, we rely on plugin developers and long-standing volunteers (like you) to help us and uphold this particular guideline.
When you help users here and in public, you also help the next person with the same problem. They’ll be able to read the debugging and solution and educate themselves.
@sterndata many apologies and completely understandable.
Ill figure out another way to help @petraagency so were both covered.
-
This reply was modified 2 years ago by
- The topic ‘exclude certain pages when navigating pages’ is closed to new replies.