Recent posts and first featured

The easiest way would be using CSS, so you don’t have to change the PHP. Assuming you have a or some other wrapping element that contains all your posts, you could use something like .main-content.span12 img { width:50%; height:auto; } .main-content.span12 h4 { font-size:1em; } .main-content.span12:first-child img { width:100%; } .main-content.span12:first-child h4 { font-size:2em; } … Read more

Getting Custom Post Loop to display in Bootstrap 3 column grid

You needs to change Your code like following: <section id=”services”> <div class=”container”> <h2></h2> <p class=”lead”></p> <?php query_posts(‘posts_per_page=3&cat=6&post_type=our_services’); ?> <div class=”row”> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div class=”col-sm-4″> <?php if ( has_post_thumbnail()) { $url = wp_get_attachment_url( get_post_thumbnail_id() ); ?> <img src=”https://wordpress.stackexchange.com/questions/264672/<?php echo $url; ?>” alt=”<?php the_title() ?>”> <h3><?php … Read more

How to Restrict Previous & Next Post Link to Posts of Same Category?

Choose from any of the following functions: get_next_post_link(); next_post_link(); get_previous_post_link(); previous_post_link(); Parameters are as follows (in respective order): @param string $format Optional. Link anchor format. Default ‘« %link’. @param string $link Optional. Link permalink format. Default ‘%title’. @param bool $in_same_term Optional. Whether link should be in a same taxonomy term. Default false. @param array|string $excluded_terms … Read more

Can’t get buddypress notifications in front-end; why do I get this error?

use this: if ( !function_exists( ‘bp_core_get_notifications_for_user’ ) ) { require_once ‘/wp-content/plugins/buddypress/bp-core/deprecated/1.9.php’; } function cg_current_user_notification_count() { $notifications = bp_core_get_notifications_for_user(bp_loggedin_user_id(), ‘object’); $count = !empty($notifications) ? count($notifications) : 0; echo $count;}

Pausing and Resuming WP_Query results

I think the best way to approach this might be to run your WP_Query just one time, but then access the stored query results three times to output each wanted set of data. This will save you from using multiple DB queries, and by using three separate loops, you can still add a parent div … Read more