Some CSS classes missing when rendering the page with get_the_content()

You can achieve that by applying the the_content filters, just like what the_content() does: $content = get_the_content(); $content = apply_filters( ‘the_content’, $content ); $content = str_replace( ‘]]>’, ‘]]>’, $content ); echo $content; Or the other way is by applying do_blocks() on the content: $content = get_the_content(); $content = do_blocks( $content ); echo $content;

Return the_content() with custom div class for a subset of posts

This can be done in multiple different ways. For example: 1. Using the_content filter hook: Use the_content filter hook to wrap the output of the_content() function call with your required div. You may try the following CODE in your theme’s functions.php file or in a custom plugin: add_filter( ‘the_content’, ‘wpse_specific_the_content’ ); function wpse_specific_the_content( $content ) … Read more

How I can show short content with short tag

function abc_the_content($num_words) { global $post; $content = $post->post_content; $content = strip_tags($content); $content = wp_trim_words($content, $num_words, $more = null); echo apply_filters(‘the_content’, $content); } change the strip tags line to this one if you want to strip out only the img tag $content = preg_replace(“/<\/?img(.|\s)*?>/i”, ”, $content);

Which action/filter can i use for a Member Plugin [closed]

You could try this: function restricted_access() { if( ! is_user_logged_in() ) { global $wp_query; $wp_query->set_404(); status_header(404); } } add_action( ‘wp’, ‘restricted_access’ ); By default, always, if the user is not logged in it will give them the 404 page. The following two functions will keep non-admins out of your Admin Panel and will also hide … Read more