• Resolved clecocq

    (@clecocq)


    Hello!

    Thanks for the job done on this plugin.

    I have a question, I’ve notice this: “Please note that in_same_meta is not compatible with custom field sorting. If order_by is set to either ‘custom’ or ‘numeric’, in_same_meta is disabled.”

    However, I definitely need it. Is there a way to get this working?

    My code:

    <?php $nextPost = next_post_link_plus( array(
    					'return' => 'href',
    					'post_type' => ' "artup_galeristes","artup_medias","artup_editeurs","artup_autres","artup_structures" ',
    					'in_same_meta' => 'artup-valider-exposant',
    					/*'order_by' => 'custom',
    					'meta_key' => 'artup-ordre-exposant',*/
    					'loop' => true
    				)
    			); ?>

    Thanks in advance

    https://www.ads-software.com/plugins/ambrosite-nextprevious-post-link-plus/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ambrosite

    (@ambrosite)

    The only way that would be possible is with a correlated subquery. There is some discussion and an example given here, in case you want to try hacking the plugin code:

    https://www.ambrosite.com/plugins/next-previous-post-link-plus-for-wordpress#comment-9523

    My post there talks about querying two different categories at the same time, but the principle could be extended to custom fields.

    Thread Starter clecocq

    (@clecocq)

    Oups sorry but I’m really really not familiar with SQL.

    Can you help with this? It will be another example for the community… ??

    Where to replace this in your plugin? which line?
    How to do? Any chance that you help constructing this subquery and tell me where to put it?

    Code is

    <?php $nextPost = next_post_link_plus( array(
    					'return' => 'href',
    					'post_type' => ' "artup_galeristes","artup_medias","artup_editeurs","artup_autres","artup_structures" ',
    					'in_same_meta' => 'artup-valider-exposant',
    					/*'order_by' => 'custom',
    					'meta_key' => 'artup-ordre-exposant',*/
    					'loop' => true
    				)
    			); ?>

    I need to order_by by artup-ordre-exposant but in the same time I have to control that artup-valider-exposant is true (it’s a boolean).

    Your plugin is really interesting, but I’m stuck with this and my customer waits for a solution.

    Thanks in advance for your help,

    Cyril

    Plugin Author ambrosite

    (@ambrosite)

    Cyril, I am sorry but it would take at least an hour to code and test this properly. It’s too much for a freebie, especially if you are doing this for a client. Besides that, I am on vacation at the moment (it is the Thanksgiving holiday here in the US). If you want to contact me off forum, I’ll try to work out something reasonable with you.

    Thread Starter clecocq

    (@clecocq)

    Hi,

    I understand don’t worry ?? it’s normal.

    Happy thanksgiving by the way.

    I contact you off forum.

    Cyril

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘order_by & in_same_meta’ is closed to new replies.