WordPress.org

Ready to get started?Download WordPress

Forums

Ambrosite Next/Previous Post Link Plus
[resolved] previous_page_link_plus returns current page (9 posts)

  1. knysha
    Member
    Posted 1 year ago #

    previous_page_link_plus returns linkt to current page, not the sorted by menu_order (ordered by CMS Tree Page View)

    $back_link = array(
    		'order_by' => 'menu_order',
    		'order_2nd' => 'menu_order',
    		'meta_key' => '',
    		'loop' => false,
    		'end_page' => false,
    		'thumb' => false,
    		'max_length' => 0,
    		'format' => '%link',
    		'link' => 'Poprzedni projekt',
    		'date_format' => '',
    		'tooltip' => '%title',
    		'in_same_parent' => true,
    		'in_same_author' => false,
    		'in_same_meta' => false,
    		'ex_pages' => '',
    		'in_pages' => '',
    		'before' => '',
    		'after' => '',
    		'num_results' => 1,
    		'return' => ''
    	);
    <?php previous_page_link_plus($back_link); ?>

    Any ideas?

    http://wordpress.org/extend/plugins/ambrosite-nextprevious-post-link-plus/

  2. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    I don't see anything wrong with your code. If you'd like to give a link to your site, I'll take a closer look.

  3. knysha
    Member
    Posted 1 year ago #

  4. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    Can you uncomment line 137 of the plugin code? That will allow me to view the SQL query that is being generated by the plugin.

  5. knysha
    Member
    Posted 1 year ago #

    Returned:

    SELECT DISTINCT p.* FROM wp_posts AS p WHERE ( p.menu_order < 9 OR p.post_title < 'Extension of Ĺšlesin Hotel' AND p.menu_order = 9 ) AND p.post_type = 'page' AND p.post_status = 'publish' AND p.post_parent = 6 ORDER BY p.menu_order DESC, p.post_title DESC LIMIT 1
  6. ambrosite
    Member
    Plugin Author

    Posted 1 year ago #

    I don't see anything wrong with that query. It looks exactly as it should.

    I did notice that the same problem is happening on this page:

    http://ebisustudio.pl/klienci/bieniasz/www/en/projekty/budynek-biurowy-kpmg-niederrusel/

    I don't know. My guess is that some of the pages do not have the menu_order field set correctly, but I would have to look at the database to be sure. Try updating the page order again for all pages under 'Projects'.

  7. knysha
    Member
    Posted 1 year ago #

    Ok, will try that.

  8. knysha
    Member
    Posted 1 year ago #

    That's weird - after exporting the whole content of website (with built-in export feature in WordPress), backuping theme and plugins and finally moving to final server... everything works like a charm o_O

    Nevertheless, thank you for your time and advices.

    BTW. I love this plugin!

  9. knysha
    Member
    Posted 1 year ago #

    Resolved.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.