Silvia
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Weird behavior of Datepicker field on front end
Started by: Silvia in: Toolset Professional Support |
2 | 3 | 4 years, 12 months ago | ||
HELP WITH NESTING VIEWS OF POSTS WITH PARENT-CHILD RELATIONSHIP
Started by: Silvia in: Toolset Professional Support |
2 | 16 | 5 years ago | ||
Import Clients as Wp Users and provide them with personal dashboard
Started by: Silvia in: Toolset Professional Support |
2 | 15 | 5 years ago | ||
Managing display of parent custom fields and RFG in child’s Content Template
Started by: Silvia
in: Toolset Professional Support
Problem: I have a one-to-many relationship between Organizzate (parent) and Consuntivi (child). I have several custom fields on the Organizzate post, including a repeatable field group (RFG). On the Consuntivi post Content Template, I would like to display the custom fields from the parent Organizzate post, as well as a View of RFG from the parent Organizzate post. Solution: To display custom fields of the parent post, you should use the Types field syntax like this: [wpv-conditional if="( '[types field="patrocinio" separator=", " item="@iniziativa-consuntivo-iniziativa.parent" output="raw"][/types]' eq '' )"] <span>Nessun patrocinio concesso</span> [/wpv-conditional] [wpv-conditional if="( '[types field="patrocinio" separator=", " item="@iniziativa-consuntivo-iniziativa.parent" output="raw"][/types]' ne '' )"] [types field='patrocinio' separator=', ' item='@iniziativa-consuntivo-iniziativa.parent'][/types] [/wpv-conditional] To display a View of RFG from the parent post, set up the View's post relationship filter to respond to a shortcode attribute "wpvrelatedto". Then use the wpv-post-id shortcode to set the value of that shortcode attribute, like this: [wpv-view name="Your RFG View" wpvrelatedto="[wpv-post-id item='@relationship-slug.parent']"] Relevant Documentation: |
2 | 6 | 5 years, 11 months ago | ||
How to build a view filtering only parent posts that have no child posts
Started by: Silvia in: Toolset Professional Support |
2 | 5 | 5 years, 11 months ago | ||
REDIRECTION PROBLEM FOR CPT WITH RGF
Started by: Silvia in: Toolset Professional Support |
2 | 11 | 5 years, 11 months ago | ||
SELECTING A LIST OF EVENTS WITH DATE = THIS YEAR
Started by: Silvia
in: Toolset Professional Support
Problem: Solution: You can find the proposed solution, in this case, with the following reply: Relevant Documentation: |
2 | 7 | 6 years, 3 months ago | ||
Retain Author field value when editing it from the front end
Started by: Silvia
in: Toolset Professional Support
Problem: I have a generic field in a Form where Users can select from different post authors. It works fine in a new post Form, but in an edit post Form the select field does not display the selected value. Solution: Use the wpv-post-author shortcode to pass the correct ID into the default attribute. [cred_generic_field field='change_post_author' type='select' class='' urlparam=''] { "required":0, "validate_format":0, "default":[[wpv-post-author format='meta' meta='ID']], "options":[ [wpv-view name="Tutti gli Utenti"] ] } [/cred_generic_field] Relevant Documentation: |
2 | 7 | 6 years, 3 months ago | ||
Help with migrating custom code provided by Support
Started by: Silvia
in: Toolset Professional Support
Problem: I have some post relationships custom code in place on my site, and the migration process indicates that it may cause problems. Solution: It's a good idea to check with support for migrating relationship code. This code should be okay, because we built in backwards compatibility for this particular case. |
2 | 5 | 6 years, 5 months ago | ||
Filter the options in Post Relationship field in wp-admin post editor
1
2
3
Started by: Silvia
in: Toolset Professional Support
Problem: I would like to filter the options shown in the Post Relationship field in the post editor screen. Only the current User's posts should be shown here. Solution: There is not a good way to do this in wp-admin, but you can use generic fields in CRED to accomplish something similar. <wpv-loop> [wpv-item index=1] {"value":"[wpv-post-id]","label":"[wpv-post-title]"} [wpv-item index=other] ,{"value":"[wpv-post-id]","label":"[wpv-post-title]"} </wpv-loop> - Add the following custom code to your functions.php file: add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 ); function prefix_clean_view_output( $out, $id ) { $ids = array( 12345 ); if ( in_array( $id, $ids )) { $start = strpos( $out, '<!-- wpv-loop-start -->' ); if ( $start !== false && strrpos( $out, '<!-- wpv-loop-end -->', $start ) !== false ) { $start = $start + strlen( '<!-- wpv-loop-start -->' ); $out = substr( $out , $start ); $end = strrpos( $out, '<!-- wpv-loop-end -->' ); $out = substr( $out, 0, $end ); } else { $start = strpos( $out, '>' ); if ( $start !== false) { $out = substr( $out, $start + 1 ); $end = strpos( $out, '<' ); $out = trim(substr( $out, 0, $end )); } } } return $out; } add_action('cred_save_data', 'cred_belongs_impresa_action',10,2); function cred_belongs_impresa_action($post_id, $form_data) { $forms = array( 67890, 98765 ); // if a specific form if (in_array($form_data['id'], $forms)) { if (isset($_POST['selectcompany'])) { update_post_meta( $post_id, '_wpcf_belongs_impresa_id', $_POST['selectcompany'] ); } } } - Change 12345 to match the ID of the View [cred_generic_field field='your-field-slug' type='select' class='' urlparam=''] { "required":0, "validate_format":0, "default":[], "options":[ [wpv-view name="your-parent-post-view-slug"] ] } [/cred_generic_field] |
2 | 34 | 6 years, 8 months ago | ||
Custom fields not displaying in Content Template
Started by: Silvia
in: Toolset Professional Support
Problem: I have two custom post types in a parent/child relationship. On the child single post Content Template, I include some information from the parent post by inserting another Content Template. Then after the parent post information I want to show custom fields from the child post. However, the custom fields do not appear, and the post context appears to remain the parent post. Solution: Instead of inserting the parent post Content Template directly into the child post Content Template, use a View filtered by post ID, supplied by a shortcode attribute. Then insert your parent post Content Template in the Loop Output of this nested View. |
3 | 12 | 6 years, 10 months ago | ||
Display Taxonomy Terms anywhere in the website via shortcode
Started by: Silvia
in: Toolset Professional Support
Problem: Solution: /** * Display term field from parent post */ function parent_post_term_field_sc( $atts ){ global $post; // Get id of parent post $parent_post_id = get_post_meta( $post->ID, '_wpcf_belongs_' . $atts['parent-slug'] . '_id', true ); // Get ID of taxonomy term assigned to parent post $term_id = wp_get_post_terms( $parent_post_id, $atts['tax-slug'], array( 'fields' => 'ids' ) ); // Output the required field for that term return types_render_termmeta( $atts['field'], array( 'term_id' => $term_id[0] ) ); } add_shortcode( 'parent-post-term-field', 'parent_post_term_field_sc' ); // Use like so by passing required attributes [parent-post-term-field field="field-slug" tax-slug="tax-slug" parent-slug="parent-post-slug"] |
2 | 7 | 6 years, 10 months ago | ||
Split: Transparent PNG image has a black background when resized
Started by: Silvia
in: Toolset Professional Support
Problem: I uploaded a transparent PNG image to a custom field. When I try to display the image at a smaller size, the transparent background turns black. Solution: In this case, the problem appears to be related to the original image encoding. Re-exporting the PNG file from Preview on a Mac fixed the issue. |
3 | 8 | 6 years, 10 months ago | ||
Build Taxonomy Archive Page with Divi Builder
1
2
Started by: Silvia
in: Toolset Professional Support
Problem: I would like to create a taxonomy archive that shows information about the current term, including some custom fields, outside the loop of posts. I would also like to include some information about the term, including custom fields, inside the loop. I would like to build this page with Divi Builder. Solution: Create a WordPress Archive for this taxonomy. Create two Content Templates - one for the content above the loop (Content Template 1) and one for the content in the loop (Content Template 2). Edit Content Template 1 with Divi Builder. Insert shortcodes to display information about the current term, including custom fields. There is currently a bug in the beta plugins that prevents you from inserting term fields in a WordPress Archive directly. Edit Content Template 2 with Divi Builder. Insert shortcodes to display the information about each post in the loop. If you need to display information about the current term, use the wpv-taxonomy-archive shortcode: [types field="image-field-slug" id="[wpv-taxonomy-archive info='id']"][/types] Relevant Documentation: |
2 | 19 | 6 years, 11 months ago |