We would like to have the ability to add listings from a custom post type and taxonomy to a page using views or shortcodes. For example, we will have a /wineries information page where we will have some content.
Then, we have a custom post type called Activities with entries. We also have a taxonomy term called Wine. We have created a WordPress Archives view here: hidden link which displays the map and listings. However, we would like to be able to display this map/grid of places on a static page using Toolset (views or shortcodes?). I have looked through the documentation, but cannot figure out how to get this to work.
Very helpful, thank you. A couple followup questions:
1 - We have a thumbnail size with cropping setup we'd like to use. We set this up in functions.php
add_image_size( 'archivethumb', 500, 350, true ); // Hard Crop Mode
To use images at this size, do I need to use the custom size selection in the image block settings? If I do this, does it add another set of thumbnails to the site files? I ask in the interest of trying to conserve space and keep load times fast.
2 - We need to randomize the output of the loop in order to make sure each business gets equal representation. I have set the ordering to random, but it is the same order on every page load. How do we make it random with each page load or browser session?
3 - We are using a custom post type "Activities" for Toolset WordPress Archives and Views. How do we exclude the default Posts post type from getting queried? We are using Posts for our blog and do not want them to show up in the map directories. I found something like this but it isn't working
//exclude posts from maps
function exclude_cpt( $query ) {
if ( $query->is_category() ) {
$query->set( 'post_type', 'post' );
}
}
add_action( 'pre_get_posts', 'exclude_cpt' );
1 - We have a thumbnail size with cropping setup we'd like to use. We set this up in functions.php
add_image_size( 'archivethumb', 500, 350, true ); // Hard Crop Mode
To use images at this size, do I need to use the custom size selection in the image block settings? If I do this, does it add another set of thumbnails to the site files? I ask in the interest of trying to conserve space and keep load times fast.
===>
To have your custom image site available as selection with image block dynamic source, you have to register its name. You can register its name using the following filter. You can add the following filter code to your theme's functions.php file:
- You can rename the name of your custom size as per your requirement instead of "ARCHIVE THUMB".
Once you add the above filter to your funcitons.php file, remove the image block and save your post/page/content template and then try to refresh it and then try to add the image block and you should be able to see that the registered name should be available as option.
2 - We need to randomize the output of the loop in order to make sure each business gets equal representation. I have set the ordering to random, but it is the same order on every page load. How do we make it random with each page load or browser session?
3 - We are using a custom post type "Activities" for Toolset WordPress Archives and Views. How do we exclude the default Posts post type from getting queried? We are using Posts for our blog and do not want them to show up in the map directories. I found something like this but it isn't working
==>
As per our support policy, we entertain only one question per ticket. Please kindly open a new ticket with every new question you many have this will help other users searching on the forum as well as help us to write correct problem resolution summery.