Allowing Users to Delete Their Posts

I don’t know what “it’s not working” you mean. It gives error or what? Maybe you should echo $_REQUEST[‘p_id’] first before delete it, just make sure you got the request. Or create a variable to store wp_delete_post and check if it works or not.

Custom Post Status & Taxonomies

Did you try adding a count callback? // Register Custom Taxonomy function custom_taxonomy() { $labels = array( ‘name’ => _x( ‘Taxonomies’, ‘Taxonomy General Name’, ‘text_domain’ ), ‘singular_name’ => _x( ‘Taxonomy’, ‘Taxonomy Singular Name’, ‘text_domain’ ), ‘menu_name’ => __( ‘Taxonomy’, ‘text_domain’ ), ‘all_items’ => __( ‘All Items’, ‘text_domain’ ), ‘parent_item’ => __( ‘Parent Item’, ‘text_domain’ ), … Read more

How to get images only attached from edit post page

I´m using this code to load all images I uploaded via edit post page: function get_gallery_images(){ global $wpdb,$post; $ids = “”; $counter = 0; $number_of_posts = 12; $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => 12, ‘post_status’ => null, ‘orderby’ => ‘rand’, ‘post_parent’ => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ($attachments as … Read more

Skip posts, but keep posts per page

Use pre_get_posts to add a meta query to the main query: function wpd_date_meta_query( $query ) { if( $query->is_post_type_archive( ‘your_post_type’ ) && $query->is_main_query() ){ $meta_query = array( array( ‘key’ => ‘Date’, ‘value’ => date(‘Ymd’), ‘compare’ => ‘>=’, ‘type’ => ‘NUMERIC’ ) ); $query->set( ‘meta_query’, $meta_query ); $query->set( ‘meta_key’, ‘Date’ ); $query->set( ‘orderby’, ‘meta_value_num’ ); $query->set( ‘order’, … Read more

WordPress get_post_meta issue

First you should make some improvements to your template file. Try this: <?php get_header(); ?> <?php global $woo_options; ?> <?php if ( $woo_options[‘woo_featured_disable’] <> “true” ) include( TEMPLATEPATH . ‘/includes/featured.php’); ?> <?php $args = array( ‘post_type’ => ‘infobox’, ‘order’ => ‘DESC’, // DESC for newer first. ‘orderby’ => ‘date’, ‘posts_per_page’ => 6 // For a … Read more