removing tags around img, iframes and also scripts

This should do it and also remove <p> tags from images that are linked. Why it removes it from only one <script> instance is hard to tell. Would have to see your website code to investigate further. // Remove p tags from images, scripts, and iframes. function remove_some_ptags( $content ) { $content = preg_replace(‘/<p>\s*(<a .*>)?\s*(<img … Read more

How to make my new theme read [youtube id=”id of the video here” width=”600″ height=”350″]?

You can for example: Copy the YouTube shortcode from the old theme to your new theme. Locate the line (most likely in the functions.php file): add_shortcode( ‘youtube’, ‘some_function’ ); and copy this line and the some_function() to your functions.php in your new theme or better yet – create a new plugin file including: /*Plugin Name: … Read more

How To Display Content from a website on wordpress page?

Although CURL requests will work, you should use wp_remote_post() to do requests to external pages, especially if you are writing a plugin or theme. (Plugin review doesn’t like CURL requests; they will ask you to convert to wp_remote_post(). See https://codex.wordpress.org/Function_Reference/wp_remote_post . The return value includes the header and all content of the request. You can … Read more

WordPress block editor embeds not working in theme (single.php)

That would be because they’re using oEmbed, not a shortcode. You should use the function the_content() to render the content of a post, as it applies all the things required to make embeds, shortcodes, etc work properly. If for some reason that’s not an option, you can apply the content filter. <?php echo apply_filters( ‘the_content’, … Read more

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