Title: Permalink Problems
Last modified: August 19, 2016

---

# Permalink Problems

 *  [karo91](https://wordpress.org/support/users/karo91/)
 * (@karo91)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/permalink-17/)
 * Hi,
    this is my website [http://www.mp3ojax.com](http://www.mp3ojax.com). i want
   to insert permalinks on the images on main page This is the code:
 *     ```
       <a href="<?php the_permalink() ?>
       <?php endif; ?>
       <?php $metadataContent = ob_get_clean(); ?>
       <?php if (trim($metadataContent) != ''): ?>
       <div class="art-PostMetadataHeader">
       <?php echo $metadataContent; ?>
       </a>
       ```
   
 * But I get urls like this:
    `http://mp3ojax.com/joseph-krikorian-artarutyun-2008/%
   3C/a%3E%3C/div%3E%3Cdiv%20class=` please can someone help me?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Arlen22](https://wordpress.org/support/users/arlen22/)
 * (@arlen22)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/permalink-17/#post-1630412)
 * [From WordPress Answers](http://wordpress.stackexchange.com/questions/452) (the
   link won’t work until at least August 18):
 * > There isn’t really enough code as an example to fully understand if there is
   > any additional issues, but the main thing which is causing the URL’s to not
   > work is the fact that the opening anchor tag is not closed. Adding a “> to 
   > the end of the first line should fix the issue. In addition the art-PostMetadataHeader
   > div should be closed.
   >     ```
   >     <a href="<?php the_permalink() ?>">
   >     <?php endif; ?>
   >     <?php $metadataContent = ob_get_clean(); ?>
   >     <?php if (trim($metadataContent) != ''): ?>
   >     <div class="art-PostMetadataHeader">
   >         <?php echo $metadataContent; ?>
   >     </div>
   >     </a>
   >     ```
   > 
   > Having said that, nesting a block level element such as a div inside of an 
   > inline element such as an anchor is not standards compliant, but this code 
   > would have the same effect of linking all the $metadataContent, while being
   > standards compliant.
   >     ```
   >     <?php endif; ?>
   >     <?php $metadataContent = ob_get_clean(); ?>
   >     <?php if (trim($metadataContent) != ''): ?>
   >     <div class="art-PostMetadataHeader">
   >        <a>"><?php echo $metadataContent; ?></a>
   >     </div>
   >     ```
   > 
 *  Thread Starter [karo91](https://wordpress.org/support/users/karo91/)
 * (@karo91)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/permalink-17/#post-1630430)
 * Thank you for your reply
    i have changed the code to this but still dont work
 *     ```
       <a href="<?php the_permalink() ?>">
       <?php endif; ?>
       <?php $metadataContent = ob_get_clean(); ?>
       <?php if (trim($metadataContent) != ''): ?>
       <div class="art-PostMetadataHeader">
       <?php echo $metadataContent; ?>
       </div>
       </a>
       ```
   
 *  Thread Starter [karo91](https://wordpress.org/support/users/karo91/)
 * (@karo91)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/permalink-17/#post-1630434)
 * This is the code of the whole page that i got right now
 * [Large code excerpt removed by moderator. Per forum rules, please use [the pastebin](http://wordpress.pastebin.com/)
   for all large code excerpts. It works better anyway.]
 *  Thread Starter [karo91](https://wordpress.org/support/users/karo91/)
 * (@karo91)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/permalink-17/#post-1630438)
 * I found it
 *     ```
       <a href="<?php the_permalink() ?>"><div class="art-PostContent">
       <?php if (is_search()) the_excerpt(); else the_content(__('Read the rest of this entry »', 'kubrick')); ?>
   
       </div></a>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Permalink Problems’ is closed to new replies.

## Tags

 * [permalink](https://wordpress.org/support/topic-tag/permalink/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [karo91](https://wordpress.org/support/users/karo91/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/permalink-17/#post-1630438)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
