I’d try populating a $Var first and then use that $Var in the class name line.
Hi Radices, I’m not having any success with that either. It’s weird.
Would you put the $Var in the plugin’s code, or would you add it to a functions.php? I guess it’s not really a function and not needed anywhere else, other than the plugin.
PS. Should say that I’m no expert, so there is the potential for a stupid mistake!
I’d put it in the plugin’s template code . Right above where you want to use it.
<?php $mem_name = get_post_meta($post->ID, "memory_name", true); ?>
<p class="post-date-timeline">'.<php? $mem_name ?>.'\'s memory from '.get_the_date().'</p>
I’m a hacker myself … just spit balling with you to try and help. Pretty sure you need to wrap the get_the_date in php tags as well.
I don’t want to take up any more of your time, although I do really appreciate it. I have a feeling it’s something to do with the plugin that is making it fail as “standard” wordpress functions (get_the_author, get_the_date) are all working fine.
What I’m doing… We’re building a community website and we want to build a timeline of people’s memories. I don’t want them to have to create an account (I don’t think they would bother), but instead there’s a front end form that creates a post when submitted. Because I want the contributor’s name to be displayed, rather than the author’s, I use a custom field to collect that. All that side works, it’s just displaying it in the plugin. As I say, the custom field displays fine everywhere except the one place I need it!
As a hacker, can you think of a workaround where I can take a name and have it display as the post author without registration, or do you think I’m going about it the right way?!
As I said before, thanks again for looking.
I found a solution here.
Does the job perfectly! Once again, thanks for your help though.