Charles
Admite hilos creados en los últimos 30 días: 0
Debates favoritos del foro
Este usuario no tiene debates favoritos.
Temas del foro creados
Status | Debate | Supporter | Voces | Mensajes | Caducidad |
---|---|---|---|---|---|
Setting open graph properties from custom fields to templates
Iniciado por: Charles en: Toolset Professional Support |
2 | 6 | hace 6 años, 3 meses | ||
View with multiple templates
Iniciado por: Charles
en: Toolset Professional Support
Problem: I have a View of custom posts. I have a custom field applied to those posts. Depending on the value of that custom field, I would like to apply a different Content Template to each item in the Loop. Solution: [wpv-conditional if="( $(type-of-post) eq '1' )"] [wpv-post-body view_template="template-1-slug"] [/wpv-conditional] [wpv-conditional if="( $(type-of-post) eq '2' )"] [wpv-post-body view_template="template-2-slug"] [/wpv-conditional] [wpv-conditional if="( $(type-of-post) eq '3' )"] [wpv-post-body view_template="template-3-slug"] [/wpv-conditional] Relevant Documentation: |
2 | 7 | hace 6 años, 3 meses | ||
Redirect each post URL to an exernal URL from a custom field
Iniciado por: Charles
en: Toolset Professional Support
Problem: I would like to redirect posts in a specific post type to a URL saved in a custom field on each post. Solution: Unfortunately Toolset isn't set up to handle redirects so this will require custom code. Here is an example: function my_cpt_template_redirect() { if( get_post_type() == 'your-cpt-slug' ) { $id = get_the_id(); $url = get_post_meta( $id, 'wpcf-' . 'your-field-slug', true ); if( $url ) { wp_redirect( $url ); die; } } } add_action( 'template_redirect', 'my_cpt_template_redirect' ); Replace your-cpt-slug with the slug of the post type where you want to apply these redirects. Replace your-field-slug with the slug of the URL field. Additional changes may be necessary based on your requirements. Relevant Documentation: |
2 | 3 | hace 6 años, 3 meses | ||
Issue with slides not linking to external link
1
2
Iniciado por: Charles
en: Toolset Professional Support
Problem: The issue here is that the user wanted to add a link to each of their individual flexslider slides. Solution: This can be done by wrapping the image in an anchor tag. <ul class="slides"> [wpv-for-each field="wpcf-flex-slider-images"] <li> <a href="[types field='amazon-url' output='raw'][/types]" target='_blank'> [types class='' field='flex-slider-images'][/types] </a> </li> [/wpv-for-each] </ul> |
2 | 24 | hace 6 años, 5 meses |