Problem in exploding the_content to array

You have a couple of issues here the_content() echos the content to screen. You should be using get_the_content() which returns the content. Just remember, get_the_content() is unfiltered, so if you need filtered content, use apply_filters( ‘the_content’, get_the_content() ) which will return filtered content. Your explode() function is probably wrong as well. You are using a … Read more

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

Excerpt is being added above the content, but it should be after it

You are echoing the content of the excerpt, which is being put into the header. Use get_the_excerpt() instead: function after_post_content($content){ if (is_single()) { $content .= get_the_excerpt(); } return $content; } add_filter( “the_content”, “after_post_content”); Generally, WordPress functions beginning with the_ will echo the output, while functions starting will get_the_… will get the value.

Don’t allow JavaScript in the content area

You could use the_content filter: add_filter( ‘the_content’, ‘remove_script_tag’ ); function remove_script_tag( $content ) { return strip_tags( $content, ‘<script>’ ); } When you also want the content of the tag to be removed you could use this one: add_filter( ‘the_content’, ‘remove_script_tag_and_content’ ); function remove_script_tag_and_content( $content ) { $striped_text = preg_replace(‘@<script>.*?<\/script>@si’, ”, $content); return $striped_text; }

WordPress adding content into different sections

Don’t do that! There are many other options to achieve this that are not hacky and messy. Here is what I would suggest. Overview First, create a child theme. This will allow you to make edits to your theme without losing them during an update. Once your child theme is setup, add a custom field … Read more

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