Support » Plugins » Hacks » Post title link

  • Hi,

    I added the Fancy Post Stamp plug in and i have it looking as i want. But the post title links are now not linking to their own article pages. The post titles should be clickable so that people can open up just that one article on its own page.

    Any help with this?

    http://blog.blueventures.org/

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Fancy Date Stamp? It appears the template is sort of mixed up. I see the old title and date with the permalink in HTML source, but it is hidden with CSS. I see a new title inside the date stamp div with no permalink.

    Can you post the portion of the template that generates the old and new date stamp and old and new titles?

    Thanks for your reply and help!
    (Ahh yes sorry Fancy Date Stamp) Hope the below helps

    This is from Fansy Date Stamp.php

    function categories(){
    	$categories = get_the_category();
    	$spacer= ' ';
    	$list= '';
    	if($categories){
    		foreach($categories as $category) {
    			$list .= '<a class"categories" href="'.get_category_link( $category->term_id ).'" title="' . esc_attr( sprintf( __( "View all posts in %s" ), $category->name ) ) . '">'.$category->cat_name.'</a>'.$spacer;
    		}
    	$categories_output = trim($list);
    	}
    return $categories_output;
    }
    
    function insert_date_stamp() {
    
    	$tday = date("d");
    	$return_string .= "".stylesheet()."
    		<div class='post-header'>
    		<div class='stamp-container'>
    			<span class = 'day'>".$tday."</span>
    			<span class ='month'>".getmonth()."</span></div>
    		<div class = 'post-title'>".get_the_title()."</div>
    			<small class = 'categories'>categories: ".categories()."</small>
    		</div>";
    
    	return $return_string;
    
    }

    Here is the main section of content.php where I have added the Fancy Date Stamp as a shortcode: <?php echo do_shortcode(“[date-stamp]”); ?>

    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
    		<header class="entry-header">
    			<?php if ( is_sticky() ) : ?>
    				<hgroup>
    					<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
    					<h3 class="entry-format"><?php _e( 'Featured', 'twentyeleven' ); ?></h3>
    				</hgroup>
    			<?php else : ?>
    			<?php echo do_shortcode("[date-stamp]"); ?>
    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    
    			<?php endif; ?>
    
    			<?php if ( 'post' == get_post_type() ) : ?>
    			<div class="entry-meta">
    				<?php twentyeleven_posted_on(); ?>
    			</div><!-- .entry-meta -->
    
    			<?php endif; ?>
    
    			<?php if ( comments_open() ) : ?>
    			<div class="comments-link">
    				<?php comments_popup_link( '<span class="leave-reply">' . __( 'Reply', 'twentyeleven' ) . '</span>', _x( '1', 'comments number', 'twentyeleven' ), _x( '%', 'comments number', 'twentyeleven' ) ); ?>
    			</div>
    			<?php endif; ?>
    		</header><!-- .entry-header -->
    
    		<?php if ( is_search() | is_home() | is_tag() | is_category() | is_archive() ) : // Edit this to show excerpts in other areas of the theme?>
    		<div class="entry-summary">
    		<!-- This adds the post thumbnail/featured image -->
    			<div class="excerpt-thumb"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
    		<?php the_post_thumbnail('excerpt-thumbnail', 'class=alignleft'); ?></a></div>
    			<?php the_excerpt(); ?>
    		</div><!-- .entry-summary -->
    		<?php else : ?>
    		<div class="entry-content">
    			<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
    			<?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'twentyeleven' ) . '</span>', 'after' => '</div>' ) ); ?>
    		</div><!-- .entry-content -->
    		<?php endif; ?>
    
    		<footer class="entry-meta">
    			<?php $show_sep = false; ?>
    			<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
    			<?php
    				/* translators: used between list items, there is a space after the comma */
    				$categories_list = get_the_category_list( __( ', ', 'twentyeleven' ) );
    				if ( $categories_list ):
    			?>
    			<span class="cat-links">
    				<?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
    				$show_sep = true; ?>
    			</span>
    			<?php endif; // End if categories ?>
    			<?php
    				/* translators: used between list items, there is a space after the comma */
    				$tags_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) );
    				if ( $tags_list ):
    				if ( $show_sep ) : ?>
    			<span class="sep"> | </span>
    				<?php endif; // End if $show_sep ?>
    			<span class="tag-links">
    				<?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'twentyeleven' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
    				$show_sep = true; ?>
    			</span>
    Moderator bcworkz

    (@bcworkz)

    OK, you have two titles going on, one generated by the date stamp without a link, and one generated by the theme with a link, but hidden by CSS.

    You can either replace the datestamp title code with the one from the theme, or remove the datestamp title code and restyle the theme title to your liking.

    The former is complicated by needing to convert mixed PHP/HTML to pure PHP. But working with mixed PHP/HTML of the theme and CSS is no picnic either, plus the category output ends up in the wrong place. I’d suggest the latter just because it is more “pure”.

    Since you are altering your theme template and CSS anyway, if you haven’t already, you should be doing this through a child theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Post title link’ is closed to new replies.