CCeliaS on "How do I postpend an anchor tag to get_permalink in this function?"

ساخت وبلاگ

Hi all,

I'm stuck. I'm working on a site that has a Parallax Banner that takes up most of the screen height.

I'm trying to modify the function that creates my "read more" links after my excerpts in my Recent Posts to link to the #content id in my single.php (opening the page after the tall banner).

I'm using the suggestion from the Codex on Customizing the Read More, (see below) but I don't know enough .php to be able to insert the anchor tag (#content) that I'd like to postpend to the get_permalink without breaking the code.

// Replaces the excerpt "Read More" text by a link
function new_excerpt_more($more) { global $post; retu '<a class="moretag" href="'. get_permalink($post->ID) . '"> Read More...</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

http://sottovocepress.com/brian/ and http://sottovocepress.com/brian/ashley-madison-hackers-come-together-to-fight-marital-infidelity/

Thoughts?

Many thanks in advance!

I think this is what you're after:
retu '<a class="moretag" href="'. get_permalink($post->ID) . '#content"> Read More...</a>';

CCeliaS
Member
Posted 11 minutes ago #

bcworkz! Thank you!

That's it!

Many, many thanks! I had the single quote in the wrong place (actually several wrong places in different attempts). I can't tell you what a relief it is to have it working!

Many, many thanks!

WordPress ...
ما را در سایت WordPress دنبال می کنید

برچسب : نویسنده : استخدام کار wpss بازدید : 310 تاريخ : يکشنبه 6 تير 1395 ساعت: 11:26