Post title as link parameter

I have in the theme file single.php a link in it (examplecars?aff=) in each post of my blog is displayed. That's

I have in the theme file single.php a link in it (example/cars/?aff=) in each post of my blog is displayed. That's how I integrated it:

$html .="<a id='test' rel='nofollow' href='/?aff=' target='_blank'>";

I would like the title of the post to be automatically written behind ?aff=

For example: /?aff=POSTTITLE

How do I accomplish this? Have googled allot but cannot find anything.

Would be glad about help!

Regards

I have in the theme file single.php a link in it (example/cars/?aff=) in each post of my blog is displayed. That's how I integrated it:

$html .="<a id='test' rel='nofollow' href='https://example/cars/?aff=' target='_blank'>";

I would like the title of the post to be automatically written behind ?aff=

For example: https://example/cars/?aff=POSTTITLE

How do I accomplish this? Have googled allot but cannot find anything.

Would be glad about help!

Regards

Share Improve this question edited Dec 7, 2019 at 13:51 Elgoots 1626 bronze badges asked Dec 7, 2019 at 9:22 MikeMike 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

I think this is what you are trying to accomplish?

$html .="<a id='test' rel='nofollow' href='https://example/cars/?aff='". echo get_the_title( $post_id ) ." target='_blank'>";

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744930110a4601684.html

相关推荐

  • Post title as link parameter

    I have in the theme file single.php a link in it (examplecars?aff=) in each post of my blog is displayed. That's

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信