Community Forums › Forums › Archived Forums › Design Tips and Tricks › Copy blog post title in more-link and comment field heading
Tagged: comment box heading, copy blog title, more link
- This topic has 6 replies, 2 voices, and was last updated 11 years, 6 months ago by David Chu.
-
AuthorPosts
-
July 18, 2013 at 4:15 am #51286July 18, 2013 at 7:40 am #51295David ChuParticipant
They're in the public documentation:
http://my.studiopress.com/snippets/post-excerpts/#content-more-link
Dave Chu · Custom WordPress Developer – likes collaborating with Designers
July 18, 2013 at 8:13 am #51300lucaswijntjesMemberThanks for your reply David. Seems like I'm getting closer
The code for the comments link isn't doing anything. I have a Dutch translation installed through the Genesis -Translations plugin. Should that affect anything?
I've been trying the more-link, but can't get it to copy the blogpost title. I have this:
/** Customize Read More */ add_filter( 'the_content_more_link', 'custom_read_more_link' ); function custom_read_more_link() { return '<a class="more-link" href="' . get_permalink() . '">Continue reading: get_the_title()</a>'; }
Thanks for your help
July 18, 2013 at 8:51 am #51306David ChuParticipantLucas,
Ah! Interesting. As it happens, this ends up being a WordPress, rather than a Genesis, question. And it has more of a standard WordPress answer. The doc example might work in a different context, maybe with the "..more" tag in the editor or something. I think this is what you want. I played with your wording just a little:add_filter('excerpt_more', 'custom_read_more_link'); function custom_read_more_link() { return '<a> ...Continue reading: ' . get_the_title() . '</a>'; }
Cheers, Dave
Dave Chu · Custom WordPress Developer – likes collaborating with Designers
July 18, 2013 at 9:08 am #51309lucaswijntjesMemberDavid, you helped me find the answer. I used a combination of the two, which works perfectly:
add_filter( 'the_content_more_link', 'custom_read_more_link' ); function custom_read_more_link() { return '<a> Continue reading: ' . get_the_title() . '</a>'; }
Thanks a lot!
Now I just need to find the solution for the comment box title. Any clue?
July 18, 2013 at 10:47 am #51318David ChuParticipantHmmmm... that comment example is for the title above existing comments, not for the comment form.
This is a bigger deal than I thought, and sorry, I don't have the time to investigate now. Here's some good reading on the subject.
Good luck, Dave
Dave Chu · Custom WordPress Developer – likes collaborating with Designers
July 22, 2013 at 10:06 am #51839David ChuParticipantHi,
As it happens, I found the answer for the Comment Box title while looking at something else. This is WordPress code, rather than being specifically for Genesis:add_filter( 'comment_form_defaults', 'dc_change_form_title'); function dc_change_form_title($arg) { $arg['title_reply'] = __('Leave a comment or whatever you want it to say'); return $arg; }
It's always a little trickier with arrays. 🙂 I have an extra "underline" there for translation, which brings up the point that one can also change these in the translation POT file, too, I believe.
Cheers, Dave
Dave Chu · Custom WordPress Developer – likes collaborating with Designers
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.