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>’; } ?>

Taxonomy archive + query attachments = duplicate results

I think the problem is that you’re passing the wrong arguments to the $attachments query, causing you not to get the intended posts in the $attachments query. Here’s what you’re doing: $args = array( ‘post_status’ => ‘inherit’, ‘numberposts’ => 0, ‘post__not_in’ => array_merge($do_not_duplicate,get_option( ‘sticky_posts’ )), ‘post_type’ => ‘attachment’, ); $args[‘tax_query’] = array( array( ‘taxonomy’ => … Read more

$wpdb->prepare with ON DUPLICATE KEY UPDATE

It’s my fault. Got the solution after @Otto’s comment: Do you actually have a duplicate key here? What is the structure of user_req and what are the keys and indexes? Here’s how my SQL query should be: INSERT INTO {$wpdb->prefix}user_req ( user_id, post_id ) VALUES ( %d, %d ) WHERE NOT EXISTS ( SELECT * … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)