hugoC-3
Fils de soutien créés au cours des 30 derniers jours : 0
Sujets de forum favoris
This user has no favorite topics.
Sujets de forum créés
Status | Sujet | Supporter | Voix | Publications | Nouveauté |
---|---|---|---|---|---|
custom sized thumbnzil images don't appear
Commencé par : hugoC-3 in: Toolset Professional Support |
2 | 6 | Il y a 5 années et 2 mois | ||
Valid site key not accepted
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: Solution: You can find the proposed solution, in this case, with the following reply: Relevant Documentation: |
2 | 7 | Il y a 5 années et 3 mois | ||
Loop with different numbers of items
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: Solution: You can find proposed solution, in this case, with the following reply Relevant Documentation: |
2 | 7 | Il y a 5 années et 10 mois | ||
Custom redirect URI for cpt?
Commencé par : hugoC-3 in: Toolset Professional Support |
1 | 2 | Il y a 6 années et 1 mois | ||
Single post view – how to manually select a specific post
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: I would like to use a View to show information about a single post. I know the post ID and I would like to pass that ID into the View's filter using a shortcode attribute. Solution: Use the Query Filter panel in the View editor screen to apply a filter by post ID, set by a shortcode attribute. Pass the desired post ID into the View shortcode using the standard attribute "ids", or modify the settings in the Query Filter to match a custom attribute you have already applied to your shortcode. Relevant Documentation: |
2 | 3 | Il y a 6 années et 1 mois | ||
Conditionally display image in archive page
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: The issue here is that the user wanted to conditionally display some images based on the taxonomy attached to a post on an Archive layout. Solution: It won't be exactly possible to do with the taxonomy archive, with the general archive like that. Instead it is possible on the individual term archive. The reason is because you are going to need to know individually which term is attached to the current post being listed. So in the archive it won't be possible. It is possible to do with a multiple view setup. Where at first you will need a view to first list the taxonomy terms in that taxonomy. Then a second view to list all the posts that belongs to each of those taxonomies. Take a look at this documentation below. From the example you see there are 4 categories Technology,Sport,Environment,Auto and that each is listing their relevant posts below them. |
2 | 5 | Il y a 6 années et 1 mois | ||
[Views] Show only posts from current category, not subcategories in taxonomy View
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: I would like to create a View that shows posts that are associated to a specific term, but not its child terms. Solution: Add the following custom code to your child theme's functions.php file: add_filter( 'wpv_filter_query', 'only_term_filter',99,3 ); function only_term_filter( $query_args, $views_settings, $view_id) { $view_ids = [12345,67890]; if (in_array($view_id, $views_ids)){ foreach($query_args['tax_query'] as $tq) { if( isset( $tq['taxonomy'] ) ){ $tax = $tq['taxonomy']; $term = get_term_by('id', $tq['terms'][0], $tax); $termChildren = get_term_children($term->term_id, $tax); $query_args['tax_query'][] = array( 'taxonomy' => $tax, 'field' => 'id', 'terms' => $termChildren, 'operator' => 'NOT IN' ); } } } return $query_args; } Replace 12345,67890 with a comma-separated list of View IDs where you want to apply this filter. Make sure your View's taxonomy filter is set up to respond to a shortcode attribute, something like "wpvcategory". Then pass the top-level term slug into the shortcode attribute like this: [wpv-view name="your-view-slug" wpvcategory="parent-term"] The View will return posts with the top-level term applied, but no posts that have to its child terms. Relevant Documentation: |
2 | 3 | Il y a 6 années et 2 mois | ||
[Views] Maps disappeared after migrating site
1
2
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: Solution: This can be caused by one of 2 issues or both. The first is that the url of the website might have changed and if you are using a restricted google maps api key then you will need to change update the key to be used with the new url. The second is that there could be some code in the theme or other plugins that is causing a conflict or throwing a Javascript error due to the new server environment. In this case it was the user's child theme that was causing the issue. |
2 | 21 | Il y a 6 années et 2 mois | ||
Populate select field with list of posts in a custom post type
1
2
Commencé par : hugoC-3 in: Toolset Professional Support |
2 | 19 | Il y a 6 années et 6 mois | ||
Populate select field with all the posts that are published
Commencé par : hugoC-3 in: Toolset Professional Support |
2 | 3 | Il y a 6 années et 7 mois | ||
Hide title if loop is empty
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: I would like to use a conditional to determine whether or not to display some text based on whether or not the View returns any results. Solution: If the loop returns no results, then the title will not show if the h4 tag is placed inside wpv-items-found: [wpv-items-found] ...this content only appears when results are found [/wpv-items-found] If you want to suppress the View entirely on posts that have category "d", then you would wrap the View's shortcode in a conditional that tests whether or not the post has a specific term: [wpv-conditional if="( has_term('d', 'category', null) ne '1' )"] ... your View shortcode here [/wpv-conditional] Replace "d" with the actual term slug, and 'category' with the taxonomy slug. Then you must register the has_term function in Toolset > Settings > Frontend Content > Functions inside conditional evaluations. Relevant Documentation: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ |
2 | 4 | Il y a 6 années et 7 mois | ||
Custom category and tag archive problems
Commencé par : hugoC-3 in: Toolset Professional Support |
2 | 11 | Il y a 6 années et 11 mois | ||
Related posts view from same category
Commencé par : hugoC-3
in: Toolset Professional Support
Problem: Solution: Select posts with taxonomy: Categories the same as the page where this View is shown This will then automatically show Posts belonging to the same Taxonomy term as the current Viewed Post. The view needs to be inserted in the Post or it's content template. Relevant Documentation: |
2 | 5 | Il y a 7 années | ||
limit CPT archive page
Commencé par : hugoC-3 in: Toolset Professional Support |
2 | 2 | Il y a 7 années et 11 mois | ||
Related posts view contains blanks
Commencé par : hugoC-3 in: Toolset Professional Support |
2 | 6 | Il y a 8 années |