Display WP posts in 3 responsive columns

<?php $the_query = new WP_Query(“showposts=6&cat=1&orderby=rand”); while ( $the_query ->have_posts() ) {$the_query ->the_post(); $i++; if ($i == 1){echo “<div class=row-fluid>”;} ?> <div class=”span4″> Random Post <?php echo $i ; ?> </div> <?php if ($i == 3){echo “</div><div class=row-fluid>”;} if ($i == 6){echo “</div>”;$i=0;} } wp_reset_postdata(); ?>

Display Custom Column in CPT Taxonomy

The final working hooks that I was able to work out are: // adding an extra column to the event_cateogires page // to display the color function events_color_column($defaults) { $defaults[‘event_cat_color’] = ‘Event Category Color’; return $defaults; } function events_color_column_content($column_name, $post_ID) { echo ‘Event Color : #2432’; } add_filter(‘manage_edit-event_categories_columns’, ‘events_color_column’); add_action(‘manage_event_categories_custom_column’, ‘events_color_column_content’, 10, 2); Using the … Read more

Centering items in a row, when you don’t know how many items [closed]

Try this instead: .container-hotel { width:78%; margin: 0 auto; text-align:center; @media (max-width: 480px) { width: 100%; } } .item-hotel { display: inline-block; vertical-align: top; text-align: left; width:230px; margin-left: 40px; @media (max-width: 480px) { float: none; display: block; width: 100%; margin-left: 0; } }

Two blogs one page

There are a variety of ways to create a two-column design in WordPress, where most typically you would use a theme that already has support for doing so. This page has a pretty nice listing of the different ways that you can create a two-column layout on your site: http://vip.wordpress.com/documentation/how-to-create-columns-in-posts/ You can also go to … Read more

Custome column sort by date not title

After a lot of guess work and research I’ve managed to come up with a simple solution. function column_orderby( $vars ) { $vars[‘orderby’] = ‘date’; $vars[‘order’] = ‘desc’; return $vars; } add_filter( ‘request’, ‘column_orderby’ ); This will sort all of the columns by ‘date’ as well as order them by ‘desc’! Hope it helps anyone … Read more

display wordpress user who published a pending post of another user

get_the_modified_author(); isn’t going to tell you who published the post, just who last edited it. You will need to capture you publisher yourself. function post_published_notification( $ID, $post ) { $publisher = wp_get_current_user(); update_post_meta($ID,’my_publisher’,$publisher); } add_action( ‘publish_post’, ‘post_published_notification’, 10, 2 ); Then use get_post_meta($post_id,’my_publisher’) to retrieve the data. Of course there are a numerous ways to … Read more

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