admin管理员组文章数量:1277317
I'm using Alike plugin to compare my custom post types, Alike provides shortcode [alike_link]
to run the procedure and I have created a shortcode to display my custom post type.
In this shortcode I made an anchor tag, I want to put Alike shortcode in href but It's not working.
You can see my code below, there is a anchor tag with href="#"
, is there any solution?
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');
本文标签: phpAlike Shortcode using in Custom Shortcode
版权声明:本文标题:php - Alike Shortcode using in Custom Shortcode 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741292094a2370611.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论