Log in

View Full Version : Index.php File within Wordpress Theme - Need to add links to the blog titles



claireym
08-06-2015, 08:47 PM
Hi there,

I have a question regarding a Wordpress theme I am using at the moment.

I have somehow managed to remove the link from my blog post titles - please see here: www.suzannetoal.com
It means that each blog post doesn't have it's page.

For example, when you visit www.suzannetoal.com the first blog post you see is "Lisa & Damien’s wedding at Crover House Hotel". I would like the title to be clickable and link into it's own page.
When I am editing that post, it does have a slug (see picture below) it is http://suzannetoal.com/lisa-damiens-wedding-at-crover-house-hotel/
however when I click on that url, nothing comes up, it is like the blog post doesn't exist?
5705

Would anyone have any ideas? Just to confrim, I would like the blog post titles to be clickable and linked into pages of their own, rather than one large collection of posts that can't be linked to individually.

I have posted my index.php file below as I'm assuming it may be to do it with, but I am far from an expert on Wordpress or Php, so please correct me if I have pasted the wrong file. I will send a virtual PayPal "coffee" your way if anyone can help me out please!

Thank you so much.


<?php get_header(); ?>

<div id="content">
<div id="primary">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>
<div id="post-<?php the_ID(); ?>" >
<?php $format = get_post_format();
if (false === $format) { $format = 'standard'; }
get_template_part('includes/post-formats/'.$format);
?>
</div>
<?php endwhile; endif; ?>
<div class="navigation">
<div class="navigation-inner clearfix">




<?php $wp_query->query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; ?>
<div class="navigation-center"><?php _e('Page', 'themerain'); ?> <?php echo $current ?> <?php _e('of', 'themerain'); ?> <?php echo $wp_query->max_num_pages ?></div>
<div class="navigation-right"><?php next_posts_link(''); ?></div>
</div>
</div>
</div>
</div>
<?php get_sidebar();

get_footer(); ?>

Beverleyh
08-07-2015, 05:08 AM
I have somehow managed to remove the link from my blog post titlesIm not a Wordpress user but if you've been editing template files, can you take a backup and then reupload the originals? Then systematically override them with your editend backups again until you find the template file that affected the change?

styxlawyer
08-07-2015, 07:36 AM
You should never edit the original theme in case there's an update and the files are over writtem. Always create a child theme and copy the files you intend to edit into that. You still have the original files in the original theme. See the Wordpress wiki (https://codex.wordpress.org/Child_Themes) for more.