How to check if a shortcode exists?
#23572 introduced shortcode_exists() into 3.6.
#23572 introduced shortcode_exists() into 3.6.
The contents of dynamic_sidebar are pulled from the widgets associated with this “Sidebar” aka “Widget Area” in wp-admin, as @s_ha_dum answered. There is no template file for the sidebar itself. Visit /wp-admin/widgets.php under Appearance -> Widgets and find the widget area titled homepage-infobox. You be able to add/remove widgets and possibly make changes to the … Read more
What you need to do is compare the values of the meta field _wp_page_template, which contains the page template selected for a single page with the available page templates. For this you need to construct an array of used templates, because you want the templates used by all the pages, similar as shown here: Return … Read more
Woo Commerce is off topic as its a plugin and not specifically related to WordPress but what you can do is copy over the single-product.php template to a WooCommerce folder in your child theme. change the file name and modify the file, then use single_template or template_include with the correct conditional tag. single_template function get_custom_post_type_template($single_template) … Read more
Hi @Alkaline: I think you are looking for this: // $page is a post where post_type==’page’ if (get_option(‘show_on_front’)==’page’) { $page_id = get_option(‘page_for_posts’); $page = get_post($page_id); } else { $page = false; }
The answer suggested by GavinR is correct. You don’t need to install the suggested plug-in, though. Just add this mini plugin and you’re set: <?php defined( ‘ABSPATH’ ) OR exit; /* Plugin Name: TinyMCE break instead of paragraph */ function mytheme_tinymce_settings( $tinymce_init_settings ) { $tinymce_init_settings[‘forced_root_block’] = false; return $tinymce_init_settings; } add_filter( ‘tiny_mce_before_init’, ‘mytheme_tinymce_settings’ ); Now … Read more
this is also a quick way; <!– <?php print_r( debug_backtrace() ) ?> –> paste it just before the closing tag
Maybe this will help. <?php /* Template Name: Featured */ get_header(); ?> Regular code here… <?php get_footer(); ?> If one theme works you could try replacing the files in the broken theme and test which file or files are broken. But first save the old files in a separate folder as a backup. Then you … Read more
Here’s a rough function I use to handle this, it should work well for anyone out there wanting to do this quick and easy. Add this this your functions.php file and then visit your site with ?template_report added onto the URL to display a report for every custom theme template. It’s rough, I’d suggest commenting/uncommenting … Read more
Not sure the following solution is better than the solution in OP, let’s just say is an alternative, probably more hackish, solution. I think you can use a PHP exception to stop WordPress execution when ‘comments_template’ filter is applied. You can use a custom exception class as a DTO to carry the template. This is … Read more