Views plugin provides an API, making it easy to display Views output using PHP.
When you ask for help or report issues, make sure to tell us all related information about your View and the data that you want to display using the Views API.
Viewing 15 topics - 106 through 120 (of 158 total)
Problem: I would like to show a View of a custom post type filtered by post author, where the BuddyPress displayed member is the post author.
Solution: Use the Buddypress PHP API to create a custom shortcode that returns the Member's User ID. Pass the user ID into the post author filter as a shortcode attribute.
// custom shortcode to return displayed BP Member's user ID
add_shortcode( 'tssupp-get-bp-member-user-id', 'tssupp_get_bp_member_user_id_func');
function tssupp_get_bp_member_user_id_func($atts)
{
if( function_exists('bp_displayed_user_id')){
return bp_displayed_user_id();
}
return null;
}
Register tssupp-get-bp-member-user-id in Toolset > Settings > Front-end Content: Third party shortcode arguments
Problem:
The user would like to build a theme template and include the Types field on it.
Solution:
Toolset does not act or allow to modify theme's templates. Toolset acts only on the return of the the_content() function.
We can create a Toolset Content Template for your custom post types or for specific posts. But the resulting HTML will only replace the_content() function from the theme's template.
Relevant Documentation:
For more information on how to customize Toolset based website using PHP, check the articles on this documentation page.
Problem: I would like to output an index value when looping over a repeating field instanced with wpv-for-each.
Solution: You'll need a custom shortcode to do this. Add the following custom shortcode definition in your child theme's functions.php file, or in a new snippet in Toolset > Settings > Custom Code.