Views is a WordPress plugin that lets you easily customize the standard WordPress listing pages using WordPress archives. You can redesign any WordPress archive, including custom post archives, taxonomy archives, author archives and search results.
When you ask for help or report issues, make sure to tell us what you have created so far and what you want to achieve.
Viewing 15 topics - 856 through 870 (of 925 total)
Problem: I would like to create a custom archive PHP template for Enfold theme, and I would like to use Layouts to design the page.
Solution: Copy an archive template file from the parent theme into the child theme, following WordPress Template Hierarchy rules. Add the Layouts initialization code to the template:
if ( defined( 'WPDDL_VERSION' )){
the_ddlayout( 'page-default' );
}
Problem: I would like to create custom links to each term displayed by the wpv-post-taxonomy shortcode.
Solution: Use a separate View of the taxonomy, filtered by term, where the term is set by the current post. Then in the Loop editor, build the custom link tags.
The issue here is that the user wanted to order their archive page.
Solution:
When creating a custom archive with views you have the option to do the order of the posts being displayed under the order settings for the archive.
If this does not work then you can manually use a hook to do the archive ordering.
Example
add_action( 'pre_get_posts', 'my_change_sort_order');
function my_change_sort_order($query){
if (($query->is_main_query()) && (is_tax('product_cat'))){
//If you wanted it for the archive of a custom post type use: is_post_type_archive( $post_type )
//Set the order ASC or DESC
$query->set( 'order', 'DESC' );
//Set the orderby
$query->set( 'orderby', 'title' );
}
};