Stop truncation of shortcodes in custom text fields?

@Milo and @Howdy_McGee had the answer. I found the section I needed to modify in my functions.php file: case ‘text’: echo ‘<input type=”text” name=”‘, $field[‘id’], ‘” id=”‘, $field[‘id’], ‘” value=”‘, $meta ? $meta : $field[‘std’], ‘” size=”30″ style=”width:97%” />’, It was the value field that was getting truncated, so I passed it through esc_attr() as … Read more

Modify Blog Module layout in Child theme

Child theme are loaded first than parent theme. And unlike other template files functions.php of child theme get merged with parent theme’s functions.php instead of being overwritten. So a function i.e. et_pb_blog() declared in parent theme can not be re-declared in child theme. Solution: Remove the shortcode in child theme Add it again with child … Read more

Replace custom gallery shortcode with default gallery shortcode

Either make a regex filter as a the_content filter, add_filter(‘the_content’, ‘my_regex_filter’, 1); // Execute as early as possible function my_regex_filter($content) { $regex = get_shortcode_regex(array(‘showgallery’)); $content = preg_replace(“https://wordpress.stackexchange.com/”.$regex.’/s’, ‘[$1gallery$3$4$5$6]’, $content ); return $content; } or rewrite your add_shortcode function. remove_shortcode(‘showgallery’); add_shortcode(‘showgallery’, ‘my_showgallery’); function my_showgallery($args) { return gallery_shortcode($args); } I would recommend the second, because it is … Read more

Using shortcode to stop post content from displaying

Instead of use of shortcode, you can get the post content, format them the way you want and display them later. You can use get_the_content function; which will just retrieve post content in a variable. $raw_input = get_the_content(); /*process your content here and store the result in variable eg.*/ $raw_input = str_replace(“No”, “Yes”, $raw_input); print … Read more

Woocommerce products shortcode specific order

function woo_products( $atts ) { global $post; $product_Out=””; $atts = shortcode_atts( array( ‘product_ids’ => ”,// your product id goes here ), $atts, ‘bartag’ ); $pro_ids = explode(“,”, $atts[‘product_ids’]); foreach ($pro_ids as $key => $values) { $product_obj = $product = wc_get_product( $values ); //call your html and data in $product out variable $product_Out .= ‘<div class=”product_name”>’.$values.'</div>’; … Read more