Title: Adding name attribute to articles
Last modified: August 19, 2016

---

# Adding name attribute to articles

 *  Resolved [jooosty](https://wordpress.org/support/users/jooosty/)
 * (@jooosty)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/adding-name-attribute-to-articles/)
 * The way the ‘more’-button works in wordpress is great. But is it also possible
   to automatically create a name attribute at every title at your homepage (so 
   at every title of every article)? That way you can directly link to the right
   place to be at my homepage. The name ID would just be the article ID, so for 
   example (my website is [http://www.weerwatnieuws.com](http://www.weerwatnieuws.com)),
   it would look like this:
 * [http://www.weerwatnieuws.com/#3169](http://www.weerwatnieuws.com/#3169)
 * When clicking on it, you should be directed to the top of the website, but to
   the part where the article is. Is it possible to change this, and where do I 
   have to do it?
 * Thanks in advance!

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

 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/adding-name-attribute-to-articles/#post-1557391)
 * from the codex: [Customizing the Read More](http://codex.wordpress.org/Customizing_the_Read_More)
 * > By default, when you click on the Read More link, the web page loads and then“
   > jumps” to the spot where the <–more–> tag is set in the post. If you do not
   > want that “jump”, you can use this code in your theme’s functions.php:
 *     ```
       function remove_more_jump_link($link) {
       $offset = strpos($link, '#more-');
       if ($offset) {
       $end = strpos($link, '"',$offset);
       }
       if ($end) {
       $link = substr_replace($link, '', $offset, $end-$offset);
       }
       return $link;
       }
       add_filter('the_content_more_link', 'remove_more_jump_link');
       ```
   
 *  Moderator [keesiemeijer](https://wordpress.org/support/users/keesiemeijer/)
 * (@keesiemeijer)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/adding-name-attribute-to-articles/#post-1557392)
 * Ok sorry, you want the same functonality as the more link for your post titles.
   
   In your theme look for: `<h2><a href="<?php the_permalink(); ?>" rel="bookmark"
   title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?
   ></a></h2>` and change like so: `<h2><a href="<?php the_permalink(); ?>#post-
   <?php the_ID(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute();?
   >"><?php the_title(); ?></a></h2>`
 *  Thread Starter [jooosty](https://wordpress.org/support/users/jooosty/)
 * (@jooosty)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/adding-name-attribute-to-articles/#post-1557393)
 * sorry for my newbieness, but do you mayby know which file i need to have (i’m
   using titan). I looked through all the files in titan, but can’t really find 
   the file you are mentioning…
 * Is this the part you are mentioning?
 *     ```
       <?php if (have_posts()) : ?>
           <?php while (have_posts()) : the_post(); ?>
           <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
       ```
   
 *  Thread Starter [jooosty](https://wordpress.org/support/users/jooosty/)
 * (@jooosty)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/adding-name-attribute-to-articles/#post-1557397)
 * Never mind, I found it (I think I was dreaming or something, cause it was just
   in the index.php…).
 * Thanks a lot!

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

The topic ‘Adding name attribute to articles’ is closed to new replies.

## Tags

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

 * 4 replies
 * 2 participants
 * Last reply from: [jooosty](https://wordpress.org/support/users/jooosty/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/adding-name-attribute-to-articles/#post-1557397)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
