Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Wordpress permalink problem

Featured Replies

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 by ChrisOliver

Could you wrap an example of what it's being shown as in [ code] tags?

 

E.g.

http://yourdomain.com/category/post-title

Edited by andyl

Have you got a link? Could you post your actual code too?

A screenshot of your permalinks settings page would also help.

Edited by andyl

  • 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:

9u0k6e.png

 

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/”

ahhh I see it :)

 

 

change:

 

<a href=”<?php the_permalink(); ?>”>

 

to

<a href="<?php the_permalink(); ?>">

 

That should fix it

  • 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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.