Posted: November 17, 2014 at 2:32 pm
|
Hello, this is the code //this can go in the themes functions.php function modified_ee_title($title, $sep) { //get the custom/meta fields //if the meta field called abc doesnt exist, return //modify the title //return the modified title } thanks |
Hi Cara, This looks like the code that Dean posted here: I can suggest wrapping the conditional so that it also checks to see if it’s in the loop. So where it has this:
you can change to this:
Aside from that, it looks like there’s a typo where it says:
that should be changed to:
|
|
|
Hi JOsh, unfortunately your correction do not make the field show at all… is there another way to target just the title in the events? |
|
Hi, Changing it here should do it:
Screenshot http://take.ms/0usMK I’ve updated the code here http://pastebin.com/jRzLjsGj |
|
HI Dean, this modified code with your suggestion is not returning anything function modified_ee_title($title, $sep) { //get the custom/meta fields //if the meta field called abc doesnt exist, return //modify the title //return the modified title } |
Hi Cara, It looks like the typo still needs fixing. Where it says:
that should be changed to:
Also, it’s not clear from the way you are posting code to the forums, but you will need to make sure that your code has proper single quotes (not curly quotes). Here’s the code I’m using on my test site, and I can verify it works: |
|
|
Yes, it is working!! thank you so much!!! you guys are the best |
|
Glad you got it working! For future reference/readers, I’ve updated the code to fix that typo (it was working on my system for some bizarre reason!) |
The support post ‘Adding a custom field to the title issue’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.