JanP6468
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 |
---|---|---|---|---|---|
Redirect from limited content to login form
Started by: JanP6468
in: Toolset Professional Support
Problem: The issue here i that the user wanted to redirect hiss guests from certain pages to a login page. This can be done by using the code below. Add it to your function.php file function wpsites_redirect_login_page() { $arr = array('my-account', 'mijn-account/','add-your-first-bike','edit-bike','edit-profile','sell-bike','report-bike','add-bike','bike-reported'); if ( ! is_user_logged_in() && is_page($arr) ) { wp_redirect( 'my_url' ); exit(); } } add_action( 'template_redirect', 'wpsites_redirect_login_page' ); Finally just add the slug of your page to the array and it will automatically redirect to a url that you can specify |
2 | 13 | 6 years, 7 months ago | ||
CRED form validation errors are not visible after form submission
Started by: JanP6468
in: Toolset Professional Support
Problem: I would like to be able to see form validation messages after I submit a CRED form, but when the page reloads my CRED form is not visible. Therefore my Users have no way of knowing that their submission was not successful. Solution: At this time, the best option is to use AJAX updates for this form. |
2 | 3 | 6 years, 8 months ago | ||
Logical problem in CRED form validation
Started by: JanP6468
in: Toolset Professional Support
Problem: I would like to add custom validation to a CRED form using the cred_form_validate hook. Some fields are required based on the selections in other fields, and I can't accomplish this in wp-admin. Solution: add_filter('cred_form_validate','form_field_validation', 2, 10); function form_field_validation( $field_data, $form_data ) { // field data are field values and errors list($fields,$errors)=$field_data; // validate if "sell" CRED form ID if ( $form_data['id'] == 1234 ) { // add validation code for each field like shown here if ( $fields['wpcf-text-field']['value'] == '' ) $errors['text-field'] = 'Text Field must not be empty'; if ( $fields['wpcf-other-field']['value'] == '' ) $errors['other-field'] = 'Text Field must not be empty'; } // validate if "missing" CRED form ID if ( $form_data['id'] == 6789 ) { // validation example for a multi-step requirement if ( ( $fields['wpcf-checkbox']['value'] == '' ) && ( $fields['wpcf-checkbox-2']['value'] == '' ) ) $errors['checkbox-2'] = 'Checkbox 2 is required if Checkbox 1 is checked'; } return array( $fields, $errors ); } Relevant Documentation: |
2 | 9 | 6 years, 8 months ago | ||
Auto-generating field content for empty fields in optional front-end post forms
Started by: JanP6468
in: Toolset Professional Support
Problem: I have a CRED form that includes an optional image field. If the User submits the form without including an image in the field, I would like to automatically choose 1 of 4 placeholder default images at random. Solution: add_action('cred_save_data', 'cred_add_default_img_action',10,2); function cred_add_default_img_action($post_id, $form_data) { $forms = array( 1234, 5678 ); // if a specific form if (in_array($form_data['id'], $forms)) { if (!isset($_POST['wpcf-slug'])) { $pics = array( "http://yoursite.com/path/to/image1.jpg", "http://yoursite.com/path/to/image2.jpg", "http://yoursite.com/path/to/image3.jpg", "http://yoursite.com/path/to/image4.jpg", ); add_post_meta( $post_id, 'wpcf-slug', $pics[ rand( 0,3 ) ] ); } } } Replace 1234, 5678 with a comma-separated list of CRED form IDs where you want to apply this code. Replace 'wpcf-slug' with your field slug, and add the 'wpcf-' prefix, replace the 4 URLs with the actual image URLs on your site. If you choose not to use 4 options, replace the '3' in 0,3 with a number one less than the number of default options. Relevant Documentation: |
2 | 5 | 6 years, 9 months ago | ||
I see post titles added by CRED having a Title like
Started by: JanP6468
in: Toolset Professional Support
ProblemI noticed that whenever a CRED Form is submitted to create a post, an exact or maybe different copy of the same post (duplicate) is created that has the title like "AutoDraft..." Why? SolutionThere are 2 Bugs provoking this issue. One with Relevannsi, and one with SEO by Yoast and Elementor. |
2 | 15 | 6 years, 9 months ago | ||
Exclusive taxonomies
Started by: JanP6468 in: Toolset Professional Support |
2 | 7 | 6 years, 9 months ago | ||
Shifted dot controls on sliders
Started by: JanP6468
in: Toolset Professional Support
Problem: The issue here is that the customer had his slider dots pagination control but they were not aligned correctly. Solution: You can actually align them by using the css below and adjusting the margin values. .pagination-dots{ margin-left: -40px !important; } |
2 | 9 | 6 years, 9 months ago | ||
Logical operators for strings
Started by: JanP6468
in: Toolset Professional Support
Problem: Solution: |
2 | 5 | 6 years, 9 months ago | ||
Manipulate the requirement of Fields in CRED
Started by: JanP6468
in: Toolset Professional Support
Problem: Solution: 1. To make a Field not required, which is required in Types: As long that another condition is not met (as in "value of another field in the CRED Form"), this required field is not shown on the Form, and hence, not required anymore. 2. To make a field required, which is not required in Types: Relevant Documentation: |
2 | 3 | 6 years, 9 months ago | ||
Redirect from limited content to Login form
1
2
Started by: JanP6468 in: Toolset Professional Support |
2 | 26 | 6 years, 9 months ago | ||
https://toolset.com/2024/11/toolset-views-3-6-17-compatibility-with-wordpress-6-7/ post link not working correctly
Started by: JanP6468
in: Toolset Professional Support
Problem: <a href="http://[wpv-post-url]"> Solution: <a href="[wpv-post-url]"> Relevant Documentation: |
2 | 5 | 6 years, 9 months ago | ||
Remove sidebar from CPT in Avada
Started by: JanP6468
in: Toolset Professional Support
Problem: I would like to remove the sidebar from a single CPT page in the Avada theme. Solution: Add some custom CSS that hides the sidebar and expands the main content. .bike-template-default.fl-builder .site-content { margin: 0 auto; max-width: 1100px; } .bike-template-default.fl-builder .site-content #primary { width: 100%; float: none; } .bike-template-default.fl-builder .site-content #secondary { display: none; } Replace "bike" with the slug of any CPT where you want to apply this change. |
2 | 7 | 6 years, 9 months ago | ||
Beaver Builder CSS lost
Started by: JanP6468
in: Toolset Professional Support
Problem: Solution: |
2 | 3 | 6 years, 10 months ago |