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… }

Post Image not displaying in category view

add_theme_support( ‘post-thumbnails’ ); only adds the ability to use Featured Images. To have them appear in your site, you’ll need to add code to at least one of your template files, your active theme’s functions.php file, or a custom plugin. // in The Loop if( has_post_thumbnail() ) { the_post_thumbnail(); } // etc. References has_post_thumbnail() the_post_thumbnail() … Read more