Custom field - Blog page - Event date

Hi.

i want to add an "event date" for my posts. (i know there are events managers out there, but there are too complicated and not needed cause i only want to show different date instead of the post published date)

I have already thought this through and i see that i can just use custom field inside the post and add there a new custom field, for ex "eventdate" and then give the value to it to show.

I ve also find the php file, content-post.php, and found the specific place that i want to replace which is the following at meta section: 
$output .= '<span class="post-date updated">'. get_the_date() .'</span>'; 

where the function get_the_date() i want to put there the custom field that i create in the post

i ve searched and found that probably is the "get_post_custom_value()" but when i enter it (i ve tried several ways)... 
get_post_custom_value('eventdate', $post_id)
get_post_custom_value('eventdate')
get_post_custom_value()

i m getting the result saying only "Aray"
what should i do to present the result i want for ex "3 September 2016"

also just an added question, because this file is in Betheme and i dont want to lose in a future update i will just copy it to the child folder or should i do an addition proceedure for it?

thank you for your help!! :)

Comments

  • Hi,

    what you ask for, requires files customization what in reference to Item Support Policy is not allowed. So if you want to modify files and don't know how, you should contact with your web developer.

    Thanks for understanding!
  • i do realize that this configuration has to do with files customization..

    but i don't request you to do it, if i was i would gladly pay you. but.. 

    i 've already done it.. all i want is help by telling me which function command should i replace to the specific place. nothing more. why is it that difficult to say?

    thanks
  • There is nothing difficult if you know coding but we need to follow the rules without any exceptions. If we will give you such information, after that we will get thousands of questions like: where to do this, in which file do that, in which line should we replace this code, etc. So please understand that files customization are not included and never won't be. And also, we do not offer any extra customization because we are too busy with current work.

    Thanks for understanding!
  • Hi there again!

    i found the solution and i'm pasting it here in case someone needs it (if this is open discussion and not private one)

    for single use: <?php echo get_post_meta(get_the_ID(),'enter here the custom field key',true); ?>

    or for use inside the article i was reffering to: get_post_meta(get_the_ID(),'enter here the custom field key',true)

    btw: i do understand your point of view and i respect it. keep up doing great updates for the themes :)

    all the best!
  • Thanks, we are happy to see that you sorted it yourself :)
Sign In or Register to comment.
This website uses cookies

We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you’ve provided to them or that they’ve collected from your use of their services.

Cookies are small text files that can be used by websites to make a user's experience more efficient.

The law states that we can store cookies on your device if they are strictly necessary for the operation of this site. For all other types of cookies we need your permission. This means that cookies which are categorized as necessary, are processed based on GDPR Art. 6 (1) (f). All other cookies, meaning those from the categories preferences and marketing, are processed based on GDPR Art. 6 (1) (a) GDPR.

This site uses different types of cookies. Some cookies are placed by third party services that appear on our pages.

You can at any time change or withdraw your consent from the Cookie Declaration on our website.

Learn more about who we are, how you can contact us and how we process personal data in our Privacy Policy.

Please state your consent ID and date when you contact us regarding your consent.