Tag Info

New answers tagged

0

I am not exactly sure what you're question is but I think you are looking for something like this, mostly cribbed from the Codex: if ( is_active_sidebar( 'sidebar-1' ) ) { ?> <ul id="primary"><?php dynamic_sidebar( 'sidebar-1' ); ?> </ul><?php } If the sidebar is not in use, no markup will display. You could add ...


0

The easiest course of action would be to write manual excerpts instead of having the system generate them. Second, would be to wrap your "content that isn't an excerpt" in a shortcode. If you look at the wp_trim_excerpt() function, which generates excerpts from post content, one of the first thing it does is strip shortcodes. For example, if you had a ...


0

Another way to code it based on the solution by @chittaranjan add_filter( 'the_content', 'remove_autop_for_image', 0 ); function remove_autop_for_image( $content ) { global $post; if ( is_singular('image')) remove_filter('the_content', 'wpautop'); return $content; }


0

Inorder to remove the p tag from the content you can use the below code <?php remove_filter ('the_content', 'wpautop'); ?>


0

You can use get_the_content() instead of the_content(). This may solve your problem and another solution is same as described by @Chittaranjan



Top 50 recent answers are included