This topic has 3 replies, 2 voices, and was last updated 7 years, 3 months ago ago by Rose Tyler
Hello,
I would like to show the current page title as subject in the Royal contact form. I found that I will have to edit theme-functions.php but I dont know what to edit. I’ve tried to replace:
'You have been contacted by ' . $name;
with:
$subject = $post_title;
But I have to define $post_title somewhere and I just dont know where and how.
I would really appreciate your help.
Many thanks in advance!
I can not edit my post (still the same problem in this forum, it says “You cannot create new topics.”), so I have to correct my post here: The code I’ve replaced is:
$subject = 'You have been contacted by ' . $name;
with
$subject = $post_title;
Hello,
Please use this code
global $post;
esc_html( get_the_title( $post->'ID' ) );
global $post;
$subject = esc_html( get_the_title( $post->'ID' ) );
Regards
You must be logged in to reply to this topic.Log in/Sign up