gatessg
Member
Posted 5 months ago #
Hello,
I am currently working on creating a custom theme but having an issue with my blog page. As you can see on the blog page I have a few test posts but they are not linking out to the single.php. I am wondering about what I need to do to make this happen so I can then style a specific single.php.
Thanks!
It appears that you are linking to the post. What does your index.php/home.php loop look like?
gatessg
Member
Posted 5 months ago #
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><?php the_title(); ?></h1>
<h4>Posted on <?php the_time('F jS, Y') ?></h4>
<p><?php the_content(__('(more...)')); ?></p>
<hr>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
try:
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
instead and that will link to the post. That is the reason it's not linking to the single.php
gatessg
Member
Posted 5 months ago #
If i delete the old code on the index.php and the new one in its place nothing seems to happen? All blog posts are now completely removed.
The new index.php should look like:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
<h4>Posted on <?php the_time('F jS, Y') ?></h4>
<p><?php the_content(__('(more...)')); ?></p>
<hr>
<?php endwhile; else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php endif; ?>
gatessg
Member
Posted 5 months ago #
Thanks this worked great for links that were plain text. However if a post has an image included in it, once you click the image it just shows the image on a blank white page instead of linking to the post. Any ideas?
I want to say that can be modified through the media panel. There is an option for whether to link to the attachment page or not. Yeah, it's been that long since I've used media upload. :(
gatessg
Member
Posted 5 months ago #