I’m trying to make my blog titles link to the full post from the preview area so the title should have the same function as the read more button. The blogs are in a masonry layout and I’m using a themeforest theme.
This is the blog page.
I believe this to be the php code that controls the layout – hope it helps.
Sorry php newbie here.
I have tried using <a href="'.get_permalink().'"><h5 class="post-title">'. get_the_title() .'</h5></a>';
but all this did was generate a broken url containing ‘.get_permalink().’” in it.
Thank you
<?php if ( '' != get_the_title() ): ?>
<h5 class="post-title"><?php the_title(); ?></h5>
<?php endif ?>
<?php if (has_post_format('link')): ?>
<a href="<?php echo $nz_link_url; ?>" title="<?php echo __("Go to", TEMPNAME).' '.$nz_link_url; ?>" target="_blank"><?php echo __("Read more", TEMPNAME); ?><span class="icon-arrow-right9"></span></a>
<?php else: ?>
<a href="<?php the_permalink(); ?>" title="<?php echo __("Read more about", TEMPNAME).' '.get_the_title(); ?>" rel="bookmark"><?php echo __("Read more", TEMPNAME); ?><span class="icon-arrow-right9"></span></a>
<?php endif ?>
<?php endif; ?>
You just need to wrap the h5 title in an anchor tag
<a>
on line 37 of your snippet. The specific code to change is:New Answer
or from you code, try:
Old Answer
You may have to update your CSS to reflect the anchor tag in front of the H5
Full Code