Get an array wich contains the post_name of every post that has the custom post_type “pelicula”

<?php // query for your post type $post_type_query = new WP_Query( array ( ‘post_type’ => ‘pelicula’, ‘posts_per_page’ => -1 ) ); // we need the array of posts $posts_array = $post_type_query->posts; // create a list with needed information // the key equals the ID, the value is the post_title $post_title_array = wp_list_pluck( $posts_array, ‘post_title’, ‘ID’ … Read more

Develop Admin Panel Page

WP_List_Table class is used to generate the List Tables that populate WordPress’ various admin screens. It has an advantage over previous implementations in that it can be dynamically altered with AJAX and may be hooked in future WordPress releases. If you want to use this class pay attention to this warning by WordPress. This class’s … Read more

Loop doesn’t show title of second post and posts thereafter

The code posted for your index.php file contains an error. The WordPress function the_post() is called twice in each iteration. As this function iterates the post index and sets up the conditionals for each post, calling this twice is the likely cause of your problem. Remove the second instance of the_post() immediately after your H2. … Read more

Remove Featured Image & All Media Uploaded to the Post

You can try using the function get_attached_media() like this: add_action( ‘before_delete_post’, ‘wps_remove_attachment_with_post’, 10 ); function wps_remove_attachment_with_post( $post_id ) { /** @var WP_Post[] $images */ $images = get_attached_media( ‘image’, $post_id ); foreach ( $images as $image ) { wp_delete_attachment( $image->ID, true ); } } Note that this will permanently delete all the image files related to … Read more

How to make default “Privacy Policy Page” a normal page?

Log into your wordpress admin area. Go to Settings-> Privacy From there, you can either select a different(unsued) page for default privacy policy page or you can create a new one within same page. So change your current privacy page to a different one and you can use it as you wish

Remove current category from post but display all others

First you need to get the categories of the current post, and then you can ‘exclude’ them by sending them through via the get_categories arguments array as $args[‘exclude’]. get_categories() uses get_terms(), you can see the list of available arguments you can use here. We get the post terms with wp_get_post_terms() and make sure that we … Read more

Counting Search results, and displaying the offset per page

I’m afraid you’re doing it a little bit wrong… Here are the problems: post_count field contains the number of posts being displayed and not the offset. wp_count_posts returns the number of posts globally, not in current query (so it will not be true for queries that have some filters). echo $post_count; . ‘-‘ . $post_count; … Read more