Add Compare Link

We came up with very handy shortcode for making this plugin easily manageable. If you want to insert the "add to compare button" into any post type just simply copy paste the short-code inside the editor.
[alike_link]. It will add the corresponding button in the post single page.

You can also change the button text and have the facility to add custom icons, instead of showing text.

You can also call the shortcode inside wp_loop

<?php echo do_shortcode('[alike_link text="compare" preview="text" icon_class="ion-arrow-swap" parent_class="custom-css-class" post_id="null"]'); ?>

You don't need to call all of the shortcode attribute inside this shortcode.

All default settings has be set by default. Use any of this attribute if you want to change the default options.

Preview: text, icon, text_icon, icon_text.

Default preview mode is text.

Also you can place the html structure anyplace inside wp_post_loop

<a href="#"
  class="alike-button alike-button-style"
  data-post-id=<?php echo esc_attr( get_the_ID() ) ?>"
  data-post-title="<?php echo esc_attr( get_the_title() ) ?>"
  data-post-thumb="<?php echo esc_url( $post_image_src[0] ) ?>"
  data-post-link="<?php echo esc_url( get_the_permalink() ) ?>"
  title="<?php echo esc_attr($value) ?>">
  <?php echo ($show_icon) ? wp_kses('<i class="'.$icon_class.'"></i>') : esc_attr($value) ?>
</a>

NOTE: Make sure you have the alike-button class name for add to compare button.

results matching ""

    No results matching ""