Display on page without widget
-
This isn’t a request, it’s a solution I came up with that others may find useful.
I wanted to pull the testimonials into a page using a custom query that would use my global css, instead of using the shortcode or the php call to the widget.
The code below usually works by using ‘category’ => ‘category-name’ , but when I used my category name ‘testimonials’, the query pulled all of my posts in to the page.
I removed the category argument and replaced it with post_type and it works perfectly now.
Hope this can help others too.
<?php
$paged = get_query_var('paged') ? get_query_var('paged') : 1;
$args = array( 'paged' => $paged, 'posts_per_page' => 10, 'orderby' => DESC, 'post_type' => Testimonials_Widget::pt );
// The Query
query_posts( $args );
// The Loop
while ( have_posts() ) : the_post(); ?>
https://www.ads-software.com/extend/plugins/testimonials-widget/
- The topic ‘Display on page without widget’ is closed to new replies.