Featured-Content/Featured Posts With Random Order

Third party themes are off topic, but I ended up checking it anyway: The Problem What comes before & after your posted code is important: Before: // Return array of cached results if they exist. $featured_ids = get_transient( ‘featured_content_ids’ ); if ( ! empty( $featured_ids ) ) { return array_map( ‘absint’, (array) $featured_ids ); } … Read more

Debugging why featured images have stopped showing in WooCommerce on the homepage [closed]

These are WooCommerce 3.x instructions only. That thread on GitHub (https://github.com/woocommerce/woocommerce/issues/14914#issuecomment-299714488) was updated by one of the Woo devs and he provided an example loop and explained what is happening: Featured was meta in 2.6, but is a taxonomy (for performance!) in 3.0 – so adjust queries to use tax_query instead of meta_query accordingly. To … Read more

Featured Posts Code – Repeated featured posts

After discussing in chat and seeing the parent index.php file: http://pastebin.com/27r0FJ3x The main loop in loop.php is not actually the main loop at all: <div id=”main” class=”<?php echo $containerWidth; ?>” role=”main”> <?php get_template_part(‘breadcrumbs’); ?> <?php if ( have_posts() ) { ?> <?php while ( have_posts() ) { ?> <?php the_post(); ?> <?php get_template_part( ‘loop’, get_post_format() … Read more

WordPress: Notice:Object of class WP_Query could not be converted to int in on line

Your problem is here: $featuredPosts = new WP_Query(); $featuredPosts->query(‘showposts=”.get_option(“mp_slides_no’).’&category_name=”.get_option(“mp_featured_cat’).”); for($i=1; $i<=$featuredPosts; $i++) { You’re creating a new instance of WP_Query to run a custom query and storing it in the $featuredPosts variable. But then you’re trying to use $featuredPosts as the upper limit of a for loop. This is what PHP is complaining about. Your … Read more

Latest Post Styled Different Than other Posts

Since you’re using the default loop (not a custom one), you can check the counter for the first (0th) loop and alter your output just for that one. The WordPress support forum had a similar question that offered this bit of code: if( $wp_query->current_post == 0 && !is_paged() ) { /*first post*/ } You can … Read more

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