Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*--------------------------------------------------------------
- ## Footer FAQ Category Shortcode
- --------------------------------------------------------------*/
- function footer_faqs_cat_query() {
- $args = array(
- 'posts_per_page' => 4,
- 'post_type' => 'faqs',
- 'cat' => 53,
- 'post_status' => 'publish'
- );
- $faqs_cat_query = new WP_Query( $args );
- if ( $faqs_cat_query->have_posts() ) :
- $html_out = '<ul class="recent-faqs-cat">';
- while ( $faqs_cat_query->have_posts() ) :
- $faqs_cat_query->the_post();
- $title = get_the_title();
- // Do stuff with each post here
- $html_out .= '<li>';
- $html_out .= '<i class="icon-box-v3-icons ff-font-et-line icon-document fg-text-dark ffb-icon-1"></i>';
- $html_out .= '<a href="http://www.ankitdesigns.com/demo/hu/patient-resources/#downloads">' . $title . '</a>';
- $html_out .= '</li>';
- endwhile;
- $html_out .= '</ul>';
- else : // No results
- $html_out = "No FAQs Found.";
- endif;
- wp_reset_query();
- return $html_out;
- }
- add_shortcode( 'show_footer_faqs_cat', 'footer_faqs_cat_query' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement