Add compare link inside post loop:

First of all you will need to decide which post type you want to compare with alike plugin.

Then you will build your comparison logic in the backend. Then you will need to add the add to compare link button.

You can directly call the [alike_link] shortcode button inside your main post loop.

Open your post type archive template in the editor. e.g. archive-post_type.php

Inside of it there is the main wp post loop query.

// The Loop
while ( have_posts() ) : the_post();

    // Here you can add your alike link shortcode
    // for do this see the code
    echo do_shortcode('[alike_link]');

endwhile; // end loop

results matching ""

    No results matching ""