Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @package Spun
- * Modification: Adding custom links to text under circles
- */
- /*
- * Get the post thumbnail; if one does not exist, try to get the first attached image.
- * If no images exist, let's print the post title instead.
- */
- $restore_widont = remove_filter( 'the_title', 'widont' );
- $postclass = '';
- $spun_image = spun_get_image( get_the_ID() );
- $circle_text_link = get_custom_field('circle_text_link');
- $circle_text = '<span class="thumbnail-title no-thumbnail">' . get_the_title() . '</span>';
- if ( !empty( $circle_text_link ) ) {
- $circle_text = "<a class='circle-link-text' href='$circle_text_link'> $circle_text </a>";
- }
- if ( '' != $spun_image ) :
- $thumb = $spun_image;
- else :
- $thumb = $circle_text;
- $postclass = 'no-thumbnail';
- endif;
- if ( 'no-thumbnail' != $postclass ) :
- $thumb .= $circle_text;
- endif;
- ?>
- <article id="post-<?php the_ID(); ?>" <?php post_class( $postclass ); ?>>
- <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php echo $thumb; ?></a>
- </article><!-- #post-<?php the_ID(); ?> -->
- <?php if ( $restore_widont )
- add_filter( 'the_title', 'widont' ); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement