Title: Link back to text
Last modified: August 21, 2016

---

# Link back to text

 *  Resolved [distrait](https://wordpress.org/support/users/distrait/)
 * (@distrait)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/link-back-to-text/)
 * Hello,
    Thank you for this needfull plugin. I would like very much each side-
   note to begin (or end) with a link back to the main text : A link that send the
   reader back to where it come from. I made it my own (and probably dirty) way.
   The following line are copied from my customized version, starting line 476.
 *  `<?php
    foreach ( $this->notes as $note_id => $note_text ) { // $note_text =
   wpautop( $note_text ); // usage de la fonction désactivée : Re-enclose notes 
   in paragraph tags to fix any shortcode-caused weirdness // ?> <li id=’note-<?
   php echo $note_id ?>’ class='<?php echo $class ?> <?php echo $class ?>-note <?
   php echo $class ?>-note-<?php echo $note_id ?>’ <?php echo $type_attr ?>><div
   class='<?php echo $class ?> <?php echo $class ?>-text <?php echo $class ?>-text-
   <?php echo $note_id ?>'<?php echo $text_color_attr ?>><p><?php echo $note_text?
   > <a href=”#ref-<?php echo $note_id ?>” title=”retour à l’envoyeur”> ↑ </a></
   p></div></li> <?php } ?>`
 * As you see I had to deactivate wpautop.
    I am sure things can be done in a smarter
   way.
 * Regards
 * [http://wordpress.org/plugins/side-matter/](http://wordpress.org/plugins/side-matter/)

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

 *  Plugin Author [setzer](https://wordpress.org/support/users/setzer/)
 * (@setzer)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/link-back-to-text/#post-4117545)
 * Hi distrait,
 * You can indeed do this without disabling `wpautop`, which is a good idea as broken`
   <p>` tags tend to crop up without it.
 * Try this:
 *     ```
       <?php
       foreach ( $this->notes as $note_id => $note_text ) {
       	$note_text .= " <a href='#ref-{$note_id}' title='retour à l’envoyeur'>↑</a>"; // Append arrow link to note
       	$note_text = wpautop( $note_text ); // Re-enclose notes in paragraph tags to fix tags broken by shortcode
       	?>
       	<li id='note-<?php echo $note_id . $append_list ?>' class='<?php echo $html_class ?> <?php echo $html_class ?>-note'>
       		<div class='<?php echo $html_class ?> <?php echo $html_class ?>-text'<?php if ( $options['user_colors']['colors_enabled'] ) echo " style='{$text_color_style}'" ?>>
       			<?php echo $note_text ?>
       		</div>
       	</li>
       	<?php
       }
       ?>
       ```
   
 *  Thread Starter [distrait](https://wordpress.org/support/users/distrait/)
 * (@distrait)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/link-back-to-text/#post-4117618)
 * Thank you !
    Will you add it in the next version ?
 *  Plugin Author [setzer](https://wordpress.org/support/users/setzer/)
 * (@setzer)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/link-back-to-text/#post-4117644)
 * Glad to help. I’ll take a look at adding this as an optional feature in a future
   release.

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

The topic ‘Link back to text’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/side-matter_dbd4c7.svg)
 * [Side Matter](https://wordpress.org/plugins/side-matter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/side-matter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/side-matter/)
 * [Active Topics](https://wordpress.org/support/plugin/side-matter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/side-matter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/side-matter/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [setzer](https://wordpress.org/support/users/setzer/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/link-back-to-text/#post-4117644)
 * Status: resolved