using shortcode in href under another shortcode
-
I am using alike plugin to compare my custom post types and alike provide shortcode [alike_link] to run the procedure and I create shortcode to display my custom post type In this shortcode I made anchor tag and I want to put alike shortcode in href but It’s not working you can see my code down bottom there is anchor tag with href=”#” is there any solution?
// function that runs when shortcode is called function wpb_demo_shortcode() { $html = ''; $html .= '<div class="crypto-box">'; $args = array( 'post_type' => 'Crypto Brokers', 'posts_per_page' => 10 ); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) { while ( $the_query->have_posts() ) { $the_query->the_post(); $html .= "<div class='crypto_content'>"; $html .= "<div class='crypto_left'>"; $html .= "<div class='crypto_img'>".get_the_post_thumbnail()."</div>"; $html .= '<a href="'.get_the_permalink().'">'.get_field('review_button').'</a>'; $html .= "</div>"; $html .= "<div class='crypto_center'>"; $html .= '<h4>'.get_the_title().'</h4>'; $html .= "<p>".get_the_excerpt()."</p>"; $html .= "</div>"; $html .= "<div class='crypto_right'>"; $html .= '<p><b>Location : </b>'.get_field('location').'</p>'; $html .= '<p><b>Leverage : </b>'.get_field('leverage').'</p>'; $html .= '<p><b>Deposit : </b>'.get_field('deposit').'</p>'; $html .= '<p><b>Spreads : </b>'.get_field('spreads').'</p>'; $html .= '<p><b>Instruments : </b>'.get_field('instruments').'</p>'; $html .= '<p><b>Platforms : </b>'.get_field('platforms').'</p>'; $html .= "</div>"; $html .= '<a href="#" class="cp_btn">'.get_field('compare_button').'</a>'; $html .= "</div>"; }; wp_reset_postdata(); }; $html .= '</div>'; return $html; } // register shortcode add_shortcode('crypto', 'wpb_demo_shortcode');
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘using shortcode in href under another shortcode’ is closed to new replies.