Cathalmb
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Fixing WordPress
In reply to: Featured Image Captions missing WP 3.7.1 ??I found a solution.
If you add the following filter to your functions.php it restores the title tag.
add_filter('wp_get_attachment_image_attributes', 'my_img_title', 10, 2); function my_img_title($attr, $attachment = null){ $attr['title'] = get_post($attachment->ID)->post_title; return $attr; }Thanks to Obe1 in http://wordpress.org/support/topic/title-tag-in-featured-image?replies=11
Forum: Fixing WordPress
In reply to: Blog Listings Template – Used for multiple parent blogsMy full code is:
<div id="bloglistings"> <?php wp_reset_query(); ?> <?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'post_type' => 'post', 'paged' => $paged, 'posts_per_page' => 6, 'post_parent' => $pagename, 'order' => 'DESC', 'orderby' => 'ID', ); $wp_query = new WP_Query( $args ); if ( $wp_query->have_posts() ) : ?> <div class="row"> <?php $count=0; ?> <?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?> <div class="span6"> <div class="media feature one"> <a class="pull-left" href="<?php the_permalink(); ?>"> <?php echo get_the_post_thumbnail($page->ID, 'thumbnail', array('class' => 'img-circle')); ?> <img class="hoverimage" src="<?php echo get_template_directory_uri(); ?>/img/icon-read-bloglistings.png" alt=""> </a> <div class="media-body"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> <p class="date"><?php the_time('F j, Y'); ?></p> <p><?php $my_excerpt = get_the_excerpt(); if ( $my_excerpt != '' ) { // Some string manipulation performed } echo $my_excerpt; // Outputs the processed value to the page ?> </p> </div> </div> </div> <?php $count++; ?> <?php if ($count==2 ||$wp_query->found_posts==0) : echo '</div><div class="row">'; ?> <?php $count=0; ?> <?php endif; ?> <?php endwhile; ?> <?php else : ?> <h2>Sorry but there are no posts.</h3> <?php endif; ?> <!-- PAGINATION --> <div class="pagination"> <ul> <li> <?php $big = 999999999; // need an unlikely integer echo paginate_links( array( 'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ), 'total' => $wp_query->max_num_pages, ) ); ?> </li> </ul> </div> <?php wp_reset_query(); ?> </div><!-- /.row --> </div><!--/bloglistings-->
Viewing 2 replies - 1 through 2 (of 2 total)