Add something to beginning of the content

the_content is also a filter, into which the content is passed as an argument. You simply prepend your content and then return like so. add_filter(‘the_content’,’prepend_this’); function prepend_this($content) { $content = “string to prepend” . $content; return $content }

How can i remove all html tags from get_the_content()?

The WordPress function, at least the one I tend to use, would be wp_filter_nohtml_kses. That should remove all of the HTML, but you need to be careful not to put some HTML back by running the_content filters on your HTML-less string. I am not sure why strip_tags didn’t work, but I suspect that you doing … Read more

Remove specific shortcode from get_the_content()

If you want exactly this shortcode: to output nothing, then you can use the wp_video_shortcode_override filter or the wp_video_shortcode filter to achieve that. Here are two such examples: Example #1 /** * Let the shortcode output “almost” nothing (just a single space) for specific attributes */ add_filter( ‘wp_video_shortcode_override’, function ( $output, $attr, $content, $instance ) … Read more

Insert Custom HTML After Shortcode

I wonder if you could override the [rev_slider] with this kind of wrapper: add_shortcode( ‘rev_slider’, function( $atts = array(), $content=”” ) { $html=””; // Your custom banner HTML $banner=”<div id=”bannerHTML”><!– banner HTML goes here –></div>”; // Append your banner HTML to the revslider’s output if( function_exists( ‘rev_slider_shortcode’ ) ) $html = rev_slider_shortcode( $atts, $content ) … Read more

Where to hook into post content?

You can use the_content with an high prioriety (lower number). add_filter( ‘the_content’, function( $content ) { return ‘Hello World ‘.$content; }, 0); You can even use negative priority: add_filter( ‘the_content’, function( $content ) { return ‘Hello World ‘.$content; }, -10); Note that this will apply everytime ‘the_content’ is used, no matter the post type, or … Read more

remove tags from the_content

By default, WordPress adds paragraph tags to category descriptions. Stop this by adding the following to your functions.php file // Remove p tags from category description remove_filter(‘term_description’,’wpautop’); Simple and easy (codeless). Thank you

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)