Meta query for custom post type ignored in main query
Meta query for custom post type ignored in main query
Meta query for custom post type ignored in main query
You can attach code to change role when post status is changing from “pending” to “published” see documentation: http://codex.wordpress.org/Post_Status_Transitions Then, if user has role “contributor” you can change this to “author”: add_action( ‘pending_to_publish’. ‘my_function’, 10, 1 ); function my_function( $post ) { $wp_user_object = new WP_User( $post->post_author ); if ( in_array(‘contributor’, $wp_user_object->roles ) ) { … Read more
For your my_ajax_admin_add_track() function, grab the form field data from the $_POST array, populate the required data in an array to call wp_insert_post(), then call wp_insert_post() passing it the post data. It should return the new post ID number if successful.
You are almost there you just need to call it inside your theme file say in your index.php inside the loop somewhere between <?php while ( have_posts() ) : the_post(); ?> /// /// <?php endwhile; // End the loop. ?> you need to add a call for that image using get_post_meta() like this: <?php while … Read more
The sequence field would determine where the promo post appears (position 2, 6, 8)? Anyway, I’d do it (and actually have done it) that way and would do it like that again. No other, more elegant way that comes to my mind.
If you’ve already got a solution that works using FeedPress you might as well stay with that, there isn’t a particularly clean way of aggregating multisite posts into a single blog. One alternative is to use the Sitewide Tags plugin, but given what you want to do, you should probably stay with what’s working.
something like this will work: function record_hit_if_post(){ global $wp_query; if($wp_query->is_single==1) // single post’s ID: // $wp_query->post->ID; } add_filter(‘template_redirect’, ‘record_hit_if_post’);
There isn’t much native functionality in WP to apply admin powers on front end. Front-end Editor plugin is usually great for such, but changing post status is one feature it seems to lack (maybe it’s worth suggesting to scribu). So you are basically stuck with writing this from scratch – implementing JS on front end … Read more
This is essentially a duplicate of this question: How to rename default posts-type Posts
$cat->1176 cannot be a property of an object. PHP Manual: A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores. As a regular expression, it would be expressed thus: ‘[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*’ Use $cat->term_id and compare it’s value with the number you’re out for. And … don’t use … Read more