Loop don’t work within single.php page

To give you a more thorough answer I would have to see some actual code, but I think the gist of the answer is in the file you are trying to use. “single.php” is the template file used to display the content of a single post, as the name implies. It isn’t meant for displaying … Read more

Best Way to Add UnEditable HTML to Posts

Is there a way to make it so that the user cannot delete certain things inside posts content? You need… A shortcode that will generate the content. This will let your users provide input but the markup can be rigidly controlled. Or a custom meta field. The markup around this can also be rigidly controlled, … Read more

Send POST request to WordPress to make a new post

I would recommend using XML-RPC. You can find the documentation here. This is a more mature and secure approach than building your own functionality that already exists in core. You can find all of the methods for various operations here.

Prevent Title Edit In post.php

You can use a simple jQuery code to disable the title field. jQuery(document).ready(function() { poststatus = /* get this from your php code */ if( poststatus != “auto-draft” ) { jQuery( “#title” ).attr( ‘disabled’, true ); });

preg_replace not removed “class”

The hook post_thumbnail_html is just working for featured images aka post thumbnails, hence the name. I’m guessing that’s what you’re missing and where the “problem” originates. But luckily there is another hook for manipulating image tags get_image_tag, there is actually one for just altering the class get_image_tag_class too. Take a look into those. Another hook … Read more

How to detect when admin user is on the All Posts page?

If you need exactly on All Posts page, Not on All Pages, nor All Products or etc – if ( ‘edit.php’ === $GLOBALS[‘pagenow’] && ( isset( $GLOBALS[‘typenow’] ) && ” == $GLOBALS[‘typenow’] || ‘post’ == $GLOBALS[‘typenow’] ) ) { // Do what you like… }