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 vlaue="compare" show_icon="true" icon_class="fa fa-heart"]'); ?>

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

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

results matching ""

    No results matching ""