• 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

Viewing 7 replies - 31 through 37 (of 37 total)
  • Thread Starter petraagency

    (@petraagency)

    I couldn’t see the difference between the first code and the second code you sent?

    Plugin Author Jo4nny8

    (@jo4nny8)

    @petraagency

    The post ids weren’t in an array format -> I added brackets around them

    Thread Starter petraagency

    (@petraagency)

    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

    Plugin Author Jo4nny8

    (@jo4nny8)

    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);

    Thread Starter petraagency

    (@petraagency)

    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 3 years, 8 months ago by petraagency.
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    @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:

    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.

    Plugin Author Jo4nny8

    (@jo4nny8)

    @sterndata many apologies and completely understandable.

    Ill figure out another way to help @petraagency so were both covered.

Viewing 7 replies - 31 through 37 (of 37 total)
  • The topic ‘exclude certain pages when navigating pages’ is closed to new replies.