How to determine if WP_DEBUG is enabled? [duplicate]
You can just check the value of the constant. if( WP_DEBUG === true ) { // enabled } else { // not enabled }
You can just check the value of the constant. if( WP_DEBUG === true ) { // enabled } else { // not enabled }
Looking at wp-includes/template-loader.php … there seems to be a way: if ( $template = apply_filters( ‘template_include’, $template ) ) include( $template ); You could hook into that filter, handle the including in a callback function and return FALSE. Sample code, not tested: add_filter( ‘template_include’, function( $template ) { get_header(); include $template; get_footer(); return FALSE; });
Hi @Ash G: I didn’t follow 100% where you were specifically having problems so I’m not sure I really can answer your issues point-by-point but I can explain how to do this from ground up. And unless what you are doing is a good bit more involved then you mentioned it’s a little bit more … Read more
Set the ‘input’ to ‘html’ and write out the html for the input: function filter_attachment_fields_to_edit( $form_fields, $post ) { $foo = (bool) get_post_meta($post->ID, ‘foo’, true); $form_fields[‘foo’] = array( ‘label’ => ‘Is Foo’, ‘input’ => ‘html’, ‘html’ => ‘<label for=”attachments-‘.$post->ID.’-foo”> ‘. ‘<input type=”checkbox” id=”attachments-‘.$post->ID.’-foo” name=”attachments[‘.$post->ID.’][foo]” value=”1″‘.($foo ? ‘ checked=”checked”‘ : ”).’ /> Yes</label> ‘, ‘value’ => … Read more
When I use WordPress Import in this cases, this is what I do: Export the XML in localhost. Open the exported file in a text editor. Search and replace http://localhost/wp-content/uploads/ for http://example.com/custom-temporary-folder/. Upload the uploads folder via FTP to the custom-temporary-folder. Perform the Import in example.com using the modified XML file.
There are three things to check: Is your parent theme complete and what is the exact spelling of the parent theme’s name in its style.css. Uppercase and lowercase are important. Is the child theme directory named parentname-child. It should be in the themes directory, not in a subdirectory of the parent theme. Does the child … Read more
No, content.php and content-single.php are not the same thing. In your example CODE: if (get_post_format() == false) { get_template_part(‘content’, ‘single’); } else { get_template_part(‘content’, get_post_format()); } WordPress will load content-single.php when get_post_format() is false. However, get_template_part( $slug, $name ) may still try to load content.php when you call it with get_template_part(‘content’, get_post_format()); in the following … Read more
You can debug the result of attachment by : console.log(attachment); and if the thumbnail size available you can retrieve it using : var thumb = attachment.sizes.thumbnail.url; alert(thumb);
If the theme repository is anything like the plugins one, content that hasn’t been updated in a while gets hidden, even if it still works. Its probably a good idea to check themes and plugins at least once a year against the latest version, update their meta information, and check them into the repository as … Read more
Use Plugin Organizer. http://wordpress.org/extend/plugins/plugin-organizer/. It cant disable plugins by template but it can disable them by post, page, custom post_type, or arbitrary URL.