2 wordpress loops showing 1 post from same post type – how to avoid showing the same post?

Your two queries are identical, meaning you only need one of them. The basic solution is: global $testimonials; $testimonials = new WP_Query(array( ‘posts_per_page’ => 2, /* <– get both */ ‘post_type’ => ‘testimonial’, ‘post_status’ => ‘published’, ‘orderby’ => ‘rand’, ‘ignore_sticky_posts’ => true /* you need this to control post count accurately */ )); // header … Read more

$wpdb->insert Giving duplicates

There is nothing that prevent duplicates here. When you create the table ‘church’ is a good idea set a UNIQUE sql index for field email, in this way you can rely on email address to preventing duplicate entries. As a generic PHP good practice, you should check the existence of a a variable before using … Read more

How to allow duplicate comments AND without comment text

WordPress will not allow you, using its default comment process, to insert empty comments into the database. This is enforced by wp_handle_comment_submission() with the following unconditional code: if ( ” == $comment_content ) { return new WP_Error( ‘require_valid_comment’, __( ‘<strong>ERROR</strong>: please type a comment.’ ), 200 ); } If you insist on using comments, you … Read more

Multiple URLs with Numbers

You could try adding this above your wordpress rules in your .htaccess: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^about-us/([^/]+)/([0-9]+)/$ about-us/$1/ [R=301,L] It isn’t very useful, but that could be a good thing. It would redirect any grandchild of the about-us directory that is only numbers to its parent page (child of about-us). This one is universal. In … Read more

Multi row post list

Ended up with using this code: <?php query_posts(‘category_name=Menucard’); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class=”span4 post move pull-left”> <?php //echo post here the_content(); ?> </div> <!– close .post div –> <?php $counter++; if ($counter % 3 == 0) { echo ‘<div style=”clear:both;”></div>’; } ?>