How to add custom field information with an action hook at the end of the post

Posted in: Newspaper
Post count: 8

At the end of the post, there is a short section, that shows the source / via information and the tags. How can I add more information, e.g. a custom field, just below this block, still within the <div class="td-post-source-tags"> tag? I want to add some extra information that looks like the ‘tags’ information.

Post count: 6535

Hi

You can add a custom filed using this add_post_meta() function. For more details in this regard please check this link: https://codex.wordpress.org/Function_Reference/add_post_meta To echo out the new meta use get_post_meta() https://developer.wordpress.org/reference/functions/get_post_meta/
You have to edit the file corresponding with post template used and echo out the custom filed in desired container.

Note that this is a complex task which involve some customizations and also good coding skills are involved in order to be completed. We can’t offer customization services at the moment so if you still need guidance on this or you’re not aware of the steps you need to take in this regard please consider hiring a developer or a freelancer to do this for you.

Thanks!

Post count: 8

Hi Andrei, thank you for your reply. I already have the custom field set up. This is not an issue. I also know how to get the data from the database to the frontend. The thing is, I don’t want to change the code of YOUR php file. Because, when I update your theme, my changes will be lost and need to be implemented again. Therefore I was hoping that I could add this functionality with a hook.

But if I understand you correctly, changing the code is the only option I have, right? There is no action hook for changing this, correct?

Post count: 6535

Hi

You can try to use the child theme if the files which need to be edited can be overwritten from child theme. Please check this link for more detail about child theme support https://forum.tagdiv.com/the-child-theme-support-tutorial/

Thanks!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.