Viewing 9 replies - 1 through 9 (of 9 total)
  • 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

    (@wp_design)

    I want to put a CSS class inside the the_content(‘Read more’) [a] tag:

    For example: [a href=”#” class=”cssclass”]Read more[/a]

    ah! I see…

    Sorry, I’m not sure how to go about that without hacking core files.

    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>.

    Squonk, yes, it would, though there are valid reasons to want to reduce the amount of tags and spans and stuff.

    Understood. Thanks vavroom.

    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:

    https://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.

    Thanks Mark, but it wasn’t my wish ?? cool plugin though, I’ll have to check it out

    Thread Starter wp_design

    (@wp_design)

    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.