Articles of posts

How to permanently delete a post meta entry?

delete_post_meta seems to merely clear out the value for a given post meta key. It doesn’t really completely delete the row. I’ve been digging a lot, but I can’t seem to find any function out there that deletes the post meta entry completely. Please, could anyone point me in the right direction? Do I have […]

Articles are text-only in any “Category” instead of HTML

I run a WordPress blog at http://toile.reinom.com/ and a lot of articles are using HTML codes (mainly <h*>, <p>, <a> and <figure>). Those tags are correctly displayed on the homepage and inside any blog post. But when you browse a category (as http://toile.reinom.com/category/concevoir/concevoir-general/ ), then the articles are texts only. Same when you’re doing some […]

Automatic post deletion

I’ve built a system where I have 2 options – lifespawn of draft and lifespawn of published post (integer which marks days). If post is being published, exact date-time of publish is saved as postmeta, also lifespawn is added to that time and that value is saved to database as expiration date-time, same thing with […]

WP_Query in functions.php overrides global $post object, even with wp_reset_query()

I’ve written a function that grabs all posts that are drafts and puts them as a dropdown in my toolbar for easy access to complete. This works just fine. The problem is that it seems to mess with my global $post object, specifically when called in my post/page editor. So if I’m in my post […]

Why can posts never have a number as the link?

Here’s something interesting I noticed today – it is not possible to name a post a number – no matter what theme you use, and even if you name a post a long number that has no tag or post-name or category name conflicts, you will still get 2015 or 1826628 renamed as 2015-2 or […]

Receive each week the number of posts published

I’m trying to create an email alert every monday at midnight that will send the number of posts published the past week on the site. I created 2 variables: $post_published_to_date which is the total count of the posts on the site (I assumed here that the site was just created to there aren’t any posts […]

Understanding and using metaboxes in posts

I am developing my first theme that is not dependent on a parent theme but I am running into some back-end problems. I’m trying to add a metabox to all posts that are being written. This question is quite broad in that it covers quite a lot of features. So if that’s preferred I will […]

How to rename “Publish” metabox title in post screen

I’ve looked everywhere trying to find how to rename the “Publish” metabox title in the WordPress backend post screen. There’s help for every other metabox for changing titles and there’s help for changing everything but the title for the Publish metabox. I’m sure it’s simple but I’m just not getting close.

Random post category URL

I’m trying to get a random post URL, only in current category. This is my code, this returns the URL category, :/ <?php $current_cat = get_the_category(); $randomPost = $wpdb->get_var(” SELECT guid FROM $wpdb->posts WHERE post_type = ‘post’ IN wp_terms = $current_cat ORDER BY rand() LIMIT 1″); echo ‘<a href=”‘.$randomPost.'”> <div id=”temporadas-dropdown”>EPISODIO AL AZAR</div> </a>’; ?> […]

How to access featured image?

I saw this code as how to set a featured image for a post: // required libraries for media_sideload_image require_once(ABSPATH . ‘wp-admin/includes/file.php’); require_once(ABSPATH . ‘wp-admin/includes/media.php’); require_once(ABSPATH . ‘wp-admin/includes/image.php’); // $post_id == the post you want the image to be attached to // $video_thumb_url == the vimeo video’s thumb url // $description == optional description // […]