• Resolved edwardsfan2000

    (@edwardsfan2000)


    Somehow the title of my posts (and the excerpt and thumbnail image) on my news/blog page don’t go to the post. If you click on the posts from the homepage they do work. I did check the permalink settings but they all seem fine. Does anybody have any clue where I should look for the problem?

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Look in the archive.php file of your theme to see what is different from the index.php file.

    Thread Starter edwardsfan2000

    (@edwardsfan2000)

    Thanks for your answer but I’m not really sure…

    Okay this is the archive file:

    <?php
    ?>
    <?php get_header(); ?>
    <?php if (have_posts()) : ?>
    
    <header id="page-heading">
    	<?php $post = $posts[0]; ?>
    	<?php if (is_category()) { ?>
    	<h1><?php single_cat_title(); ?></h1>
    	<?php } elseif( is_tag() ) { ?>
    	<h1>Posts Tagged &quot;<?php single_tag_title(); ?>&quot;</h1>
    	<?php  } elseif (is_day()) { ?>
    	<h1>Archive for <?php the_time('F jS, Y'); ?></h1>
    	<?php  } elseif (is_month()) { ?>
    	<h1>Archive for <?php the_time('F, Y'); ?></h1>
    	<?php  } elseif (is_year()) { ?>
    	<h1>Archive for <?php the_time('Y'); ?></h1>
    	<?php  } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    	<h1>Blog Archives</h1>
    	<?php } ?>
    </header>
    <!-- END page-heading -->
    
    <div id="post" class="post clearfix">   
    	<?php get_template_part( 'loop' , 'home-entry') ?>                	     
    	<?php pagination(); ?>
    </div>
    <!-- END post -->
    <?php endif; ?>
    <?php get_sidebar(); ?>	  
    <?php get_footer(); ?>

    En this in the index on the blog part:

    <!-- Recent Blog Posts -->
        <?php
        //get post type ==> regular posts
            global $post;
            $args = array(
                'post_type' =>'post',
                'numberposts' => '4'
            );
            $blog_posts = get_posts($args);
        ?>
        <?php if($blog_posts) { ?>        
            <section id="home-posts" class="clearfix">
                <h2 class="heading"><span><?php if(!empty($options['recent_work_text'])) { echo $options['recent_news_text']; } else { _e('Recent News','adapt'); }?></span></h2>
                <?php
                $count=0;
                foreach($blog_posts as $post) : setup_postdata($post);
                $count++;
                //get portfolio thumbnail
                $feat_img = wp_get_attachment_image_src(get_post_thumbnail_id(), 'grid-thumb');
                ?>
                
                
                <article class="home-entry <?php if($count == '4') { echo 'remove-margin'; } if($count == '3') { echo ' responsive-clear'; } ?>">
                	<?php if ($feat_img) {  ?>
                    <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><img src="<?php echo $feat_img[0]; ?>" height="<?php echo $feat_img[2]; ?>" width="<?php echo $feat_img[1]; ?>" alt="<?php echo the_title(); ?>" /></a>
                    <?php } ?>
                    <div class="home-entry-description">
                        <h3><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php echo the_title(); ?></a></h3>
                        <?php echo excerpt('15'); ?>
                    </div> 
                    <!-- /home-entry-description -->
                </article>
                <!-- /home-entry-->
                <?php
                if($count == '4') { echo '<div class="clear"></div>'; $count=0; }
                endforeach; ?>
            </section>
            <!-- /home-posts -->      	
        <?php } ?>
    

    Should this be the same?

    See the part in the index.php that does the link for the image and title?
    <a href="<?php the_permalink(); ?>"
    It uses the_permalink() so that the link is the correct link.
    Now look in your loop-home-entry.php file where the link is made for the image and the title, to see what is being used. It will be the same link for all posts (category link). It should be fixed to be the permalink for the post instead.

    You really should be asking in the theme’s support forum, so all users can get the fix.
    Also, seeing that there is a function called pagination tells me that this theme is not in the repository, and that’s the themes that are supported here.

    Thread Starter edwardsfan2000

    (@edwardsfan2000)

    Thanks for helping me out, it works again! Great great great!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Post title linking to wrong page’ is closed to new replies.