Unable to post to Custom Field

Posted in: Newspaper
Post count: 3

Hey all,

I’m trying through python to automate posts to my WordPress page. What I’m trying to do is to post an audio link to the custom field “Featured Audio”. I’ve tried different names and am unable to do this correctly. I appreciate all input I can get.

post = {
‘title’: “Sample Title”,
‘status’: ‘publish’,
“author”: 2,
‘content’: “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.”,
‘format’: ‘audio’,
‘categories’: 14,
‘tags’: 24,
‘featured_audio’: “www.examplesite.com/hello.mp3”,
}

r = requests.post(url + ‘/posts’, headers=header, json=post)

Thanx in advance!

Post count: 35449

Hi mhk13, if I understand correctly, you want to set automatically for all posts the audio format with one audio link -> https://i.imgur.com/ZtE806n.png unfortunately, I do not know how this in code, I think that you can done it in code, but I do not have enough code skills to can help you with this custom implementation, sorry!
Thank you for your understanding!

Post count: 3

Thnx for your reply Calin,

Can I ask then where I can find the “single post” file in WordPress File Manager? the file responsible for all posts made in the template.

I’ve tried to add custom code in the file “single.php” but cant see that it works.

Best regards,

Post count: 35449

Hi,
If you are using a single post template from tagDiv Cloud library, then the path is this one wp-content/plugins/td-cloud-library/shortcodes/single/tdb_single_content.php
If you are using standard post styles, then the path is this one wp-content/plugins/td-standard-pack/Newspaper/parts/single or for default template from theme when tagDiv Standard pack is activate wp-content/plugins/td-standard-pack/Newspaper/loop-single.php or single.php when tagDiv standard pack is not activate wp-content/plugins/td-composer/legacy/Newspaper/loop-single.php or single.php
I hope this will help you!

Post count: 3

Thnx for the wonderfull support and for your answer Calin. This was of help!

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