Query by post type or category
Found solution $posts = array_merge($posts1, $posts2); function cmp($a, $b) { return strcmp($a->post_title, $b->post_title); } usort($posts, ‘cmp’);
Found solution $posts = array_merge($posts1, $posts2); function cmp($a, $b) { return strcmp($a->post_title, $b->post_title); } usort($posts, ‘cmp’);
I have found a working solution. It’s a plugin called Advanced Menu Widget. I had to add a widget area into my theme but I can live with that, for now. It works!
I think you’re going about it the wrong way. You can use get_posts to get the attachments of the current post: $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => -1, ‘post_status’ =>’any’, ‘post_parent’ => $post->ID ); $attachments = get_posts($args); if ($attachments) { foreach ( $attachments as $attachment ) { echo apply_filters( ‘the_title’ , $attachment->post_title ); … Read more
Alright, I’ve got a plugin here which sorts it out. amr users wordpress plugin
Since I didn’t expected an answer to this question I tried it with wp_delete_attachment();. I wrote this function on a random page of my site (since the site isn’t live yet) and executed it from there. $attac_kill_ids = range(1235, 22686); //fill an array with the post_ids from the empty instances foreach( $attac_kill_ids as $kill_id ){ … Read more
The GalleryViews plugin hasn’t been updated in a while. jQuery has changed a lot since then. You’ll most likely need to either downgrade jQuery (not recommended by any means) or upgrade the plugin’s JavaScript to work with later versions of jQuery. It looks like there aren’t newer versions of the scripts so you may have … Read more
Try using the widget “custom menu” in the widgets. Create a custom menu with the pages you need and give that menu to this widget.
I Got it…. I just changed year to year1 and it worked 🙂 Don’t know what was the problem 🙂
To retrieve all posts from a category, while preserving the original Loop query, you create a new query like so: <?php $testimonials = new WP_Query( array( ‘post_status’ => ‘publish’, ‘post_type’ => ‘post’, ‘posts_per_page’ => 30, // limit number of posts for which to get ALL the comments of ‘category__in’ => array( 2, 6, 18 ) … Read more
Here is all you need to make this work, plus your actual form of course: function dopasswordstuff(){ if(isset($_POST[‘homepagepassword’])){ global $wpdb; $post_password = trim($_POST[‘passwordfield’]); $post_id = $wpdb->get_var( $wpdb->prepare(“SELECT ID FROM $wpdb->posts WHERE post_password = %s”, $post_password) ); if (!empty($post_id)) { wp_redirect(get_permalink($post_id)); } exit; } } add_action(‘template_redirect’,’dopasswordstuff’); I simplified your function considerably by leveraging the fact that … Read more