Title: &lt;?php the_content( ); ?&gt; Question
Last modified: August 18, 2016

---

# <?php the_content( ); ?> Question

 *  [wp_design](https://wordpress.org/support/users/wp_design/)
 * (@wp_design)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/)
 * Hi everyone,
    If I put this into the loop: <?php the_content(‘<span class="continue"
   >Continue</span>’); ?> It will render: [<span class="continue">Continue</span>](https://wordpress.org/support/topic/ltphp-the_content-gt-question/"?output_format=md#")
   My question is how to put the CSS class inside the tag instead:  ie. [Continue](https://wordpress.org/support/topic/ltphp-the_content-gt-question/"?output_format=md#")
   Thank you.

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

 *  [vavroom](https://wordpress.org/support/users/vavroom/)
 * (@vavroom)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439502)
 * I’m not sure what you mean by putting the class inside the tag, could you elaborate?
   what is your purpose?
 *  Thread Starter [wp_design](https://wordpress.org/support/users/wp_design/)
 * (@wp_design)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439510)
 * I want to put a CSS class inside the the_content(‘Read more’) [a] tag:
 * For example: [a href=”#” class=”cssclass”]Read more[/a]
 *  [vavroom](https://wordpress.org/support/users/vavroom/)
 * (@vavroom)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439516)
 * ah! I see…
 * Sorry, I’m not sure how to go about that without hacking core files.
 *  [Squonk](https://wordpress.org/support/users/squonk/)
 * (@squonk)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439524)
 * I’m a noob to php and WordPress but won’t it work wrapping the tag in CSS instead?
   Like: <span class=”continue”><?php the_content(‘Continue…’); ?></span>.
 *  [vavroom](https://wordpress.org/support/users/vavroom/)
 * (@vavroom)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439526)
 * Squonk, yes, it would, though there are valid reasons to want to reduce the amount
   of tags and spans and stuff.
 *  [Squonk](https://wordpress.org/support/users/squonk/)
 * (@squonk)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439527)
 * Understood. Thanks vavroom.
 *  [Mark Jaquith](https://wordpress.org/support/users/markjaquith/)
 * (@markjaquith)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439529)
 * vavroom,
 * I actually have some custom code doing a very similar thing that’s been on my
   website for a long time. I decided to simplify it and make it future-compatible
   with WP 2.1
 * So basically, I’m your 1-wish WordPress genie.
 * Here it is:
 * [http://txfx.net/files/wordpress/wp-customized-more-link.phps](http://txfx.net/files/wordpress/wp-customized-more-link.phps)
 * Left-click that link, left-click the “download” button, and then upload that 
   PHP file to your `/wp-content/plugins/` folder. Activate via WP admin.
 * You can edit the plugin and edit the `$replacement` variable to tweak the HTML.
   There are two “shortcuts” for you to use. The first one is the `%url%` shortcut,
   which will be the URL of the more link, and the second one is the `%linktext%`
   shortcut which will be the text of the link. In WP 2.1, you can customize this
   text for each entry, and the plugin will work for customized as well as generic
   more link texts if you use this `%linktext%` shortcut.
 * Example:
 * `$replacement = '<a href="%url%" class="someclass">%linktext%</a>';`
 * The default is actually the one you wanted, so you don’t even have to change 
   anything.
 *  [vavroom](https://wordpress.org/support/users/vavroom/)
 * (@vavroom)
 * [19 years, 9 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439531)
 * Thanks Mark, but it wasn’t my wish 😉 cool plugin though, I’ll have to check 
   it out
 *  Thread Starter [wp_design](https://wordpress.org/support/users/wp_design/)
 * (@wp_design)
 * [19 years, 8 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439969)
 * Thanks mark, this is exactly what I’m looking for!

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

The topic ‘<?php the_content( ); ?> Question’ is closed to new replies.

 * 9 replies
 * 4 participants
 * Last reply from: [wp_design](https://wordpress.org/support/users/wp_design/)
 * Last activity: [19 years, 8 months ago](https://wordpress.org/support/topic/ltphp-the_content-gt-question/#post-439969)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
