January 23, 201115 yr Hey guys I've been attempting to create a wordpress theme, and I've come across a problem with permalinks. I current have my permalink style set to /%category%/%postname%/ and my post title's as <div class="title"><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></div> but when I try to click them, it get a page not found. It shows the URL as http://mydomain.co.uk/”http:/mydomain/category/post title/” Does anyone know how to fix it so it goes to the single post? Thanks in advance ;D Edited January 23, 201115 yr by ChrisOliver
January 23, 201115 yr Could you wrap an example of what it's being shown as in [ code] tags? E.g. http://yourdomain.com/category/post-title Edited January 23, 201115 yr by andyl
January 23, 201115 yr Have you got a link? Could you post your actual code too? A screenshot of your permalinks settings page would also help. Edited January 23, 201115 yr by andyl
January 23, 201115 yr Author My main page code: <div class="container"> <?php get_header(); ?> <div id="menu"> <?php wp_page_menu('orderby=name&include1,3,4,5'); ?></div> <?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div id="main"> <div class="title"><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></div> <div class="entry"> <?php the_content(); ?> </div> <div class="info"> <?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php the_author(); ?> <br /> <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?> </div> </div> <?php endwhile; ?> <div class="navigation"> <?php posts_nav_link(); ?> </div> <?php else : ?> <div class="post"> <h2><?php _e('Not Found'); ?></h2> <?php endif ;?> </div> <?php get_footer(); ?> </div> </body> </html> Permalink settings: My domain: http://christopheroliver.co.uk Domain when trying to click the post title: http://christopheroliver.co.uk/”http://christopheroliver.co.uk/music/eddplant-less-than-three/”
January 23, 201115 yr ahhh I see it change: <a href=”<?php the_permalink(); ?>”> to <a href="<?php the_permalink(); ?>"> That should fix it
January 23, 201115 yr Author ahhh I see it change: <a href=”<?php the_permalink(); ?>”> to <a href="<?php the_permalink(); ?>"> That should fix it Worked perfect, thanks for that ;D
Create an account or sign in to comment