Accessing via & source CF through PHP

Posted in: Newspaper
Post count: 11

Hello, i’m trying to get access to the via and source CF through PHP, but unsuccessfully. For example

$td_source = get_post_meta(get_the_ID(), 'td_source', true);
$td_source_url = get_post_meta(get_the_ID(), 'td_source_url', true);
$td_via = get_post_meta(get_the_ID(), 'td_via', true);
$td_via_url = get_post_meta(get_the_ID(), 'td_via_url', true);

and

$td_source = get_post_meta(get_the_ID(), 'source', true);
$td_source_url = get_post_meta(get_the_ID(), 'source_url', true);
$td_via = get_post_meta(get_the_ID(), 'via', true);
$td_via_url = get_post_meta(get_the_ID(), 'via_url', true);

are not giving any result. Could you please help?

Post count: 27744

Hello,

Can you please provide more details about what you are looking to achieve to accessing the via and source? Do you want to add them in a custom field?

Thank you!

Post count: 11

Via and Source are already custom field, no? I’m trying to keep them active if we need to switch theme and disable Newspaper. Are they not stored in db?

Post count: 35449

Hi,
Indeed those elements are set in the database in wp_postmeta on meta_key ‘td_post_theme_settings’ and you can use the code from here – https://pastebin.com/v8agQYgF to display them in articles.
I hope this will help you!

Post count: 11

thank you

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