Pages with a loop (index, archive) are loading the first image as post_thumbnail
Your theme uses a custom function to get the first image, if you post your index.php codes here you maybe find someone to help.
Your theme uses a custom function to get the first image, if you post your index.php codes here you maybe find someone to help.
After some research, I came up with a solution that worked for me. It’s nice because it’s not using the WP Gallery (you don’t need to insert a gallery into your post/page to make it work). It’s awesome because you can do whatever you want inside the “images loop”. Note: the ‘preview’ in $size=”preview” is … Read more
do you have the current page number in your $query array? for example: $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $query = array( ‘paged’ => $paged );
I ended up creating two loops and utilizing anchors. I’m not sure if it’s the most efficient way of doing things, however, it works. add_action( ‘genesis_post_content’, ‘child_do_content’ ); // Adds your custom page code/content function child_do_content() {?> <ul class=”multicol”> <?php $custom_query = new WP_Query(array(‘orderby’ => ‘title’, ‘order’ => ‘ASC’,’cat=5′)); while($custom_query->have_posts()) : $custom_query->the_post();?> <li><a href=”#<?php the_title(); … Read more
You can try this: <?php // get image source: $metaboxtext3 = esc_attr( get_post_meta( get_the_ID(), ‘my_meta_box_text3’, true ) ); // get link: $metaboxtext4 = esc_attr( get_post_meta( get_the_ID(), ‘my_meta_box_text4’, true ) ); // check if the image source exists: if(strlen($metaboxtext3)>0){ ?> <a href=”https://wordpress.stackexchange.com/questions/84788/<?php echo $metaboxtext4; ?>”><img src=”<?php echo $metaboxtext3; ?>” alt=”” onerror=”this.style.display=’none'”/></a> <?php } ?>
I am answering this because nobody yet answered this and I think this could help others who are experiencing this kind of issue. As mentioned by s_ha_dum that the issue is related to FireFox’s Prefetching mechanism. In order to resolve this I inserted the below line to function.php: remove_action(‘wp_head’, ‘adjacent_posts_rel_link_wp_head’);
If you look at your var_dump, near the end, you will see the actual query being used. SELECT wp_posts.* FROM wp_posts INNER JOIN wp_term_relationships ON (wp_posts.ID = wp_term_relationships.object_id) WHERE 1=1 AND ( wp_term_relationships.term_taxonomy_id IN (93) ) AND wp_posts.post_type IN (‘post’, ‘page’, ‘attachment’) AND (wp_posts.post_status=”publish” OR wp_posts.post_author = 1 AND wp_posts.post_status=”private”) GROUP BY wp_posts.ID ORDER BY … Read more
echo “<img src=\”” . bloginfo(‘template_url’); . “/img/sample-ad-side.png\” alt=\”Sample Advertisement\”>”; You added a semicolon, what comes after that semicolon is a new statement. . “img/ etc is not valid PHP, so it errors out. Also bloginfo does not return its value, it prints it, so you need to change that to get_bloginfo. I would suggest you … Read more
Hard to say without a little more detail or seeing the entire page’s code, but I’m going to wage that your issue is $output=”<div class=”box”> “;. If you’re repeating that line before echo or printing $output, then you’re losing the value of $output. If that’s the issue, change this line to $output .= ‘<div class=”box”> … Read more
I don’t see anything that would cause the_content() to display in your code. Chances are, the template file you are editing is NOT the one being used on the page/archive you are checking. Add this to the top of your template files… <!– Template: <?php echo __file__; ?> –> Now, in your web browser view … Read more