Question

WordPress Create Post action is using the same featured image for all posts

  • 31 October 2021
  • 19 replies
  • 970 views

Userlevel 1
Badge

I have Setup the Create A post in Wordpress But Featured Image is same in all posts, which option should i Select , so that each post has its own featured image 

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

19 replies

Userlevel 6
Badge +6

Hey @jamesgerry ,

 

Can you share a screenshot of test data here? I would like to view test data to suggest a solution. Alternatively you can also try, from Trigger test data, check for some value of featured image. Now drag this value in the action

Userlevel 1
Badge

Hi here is a short video i recorded and also i have (featured_media 59535) at the Trigger Setting
but in action it is (0) 
https://www.screencast.com/t/yGH4PJ1p

 

please watch the video 

also here are the screenshots 

 

Userlevel 1
Badge

@jayeshkumarbhatia 

Userlevel 1
Badge

any one please help me

 

Userlevel 6
Badge +6

Hey @jamesgerry ,

 

Since you are using 2 blogs, their media ids can never be same. Media id of 1 blog will never be same for another blog. 

 

What you can do is add below actions in your Zap. 

Get the media url from Wordpress Blog 1 → Than add the media in 2 blog → Paste the id in your action Create a post.

 

Note - If wordpress action is not visible on Zapier, than you can make custom webhook call. To view wordpress api visit here https://developer.wordpress.org/rest-api/

Userlevel 1
Badge

Hi guys i am sorry for creating a second post as i was not getting any replys due to it getting alot lower 

My Quesiton is that , i have selected the below option in action and trigger 

but still in action i see ( (featured_media 0)

i have changed to different option there but still nothing appear 

can you please help me i really need this 

Here are few short video and screeshots 

Video : https://www.screencast.com/t/yGH4PJ1p
 

 

Userlevel 1
Badge

sir i am a beginner i know i am asking alot , but can you please guide me thorugh a screenshot or any other way , i do not get the above , 
 

Userlevel 3
Badge +1

Hi @jamesgerry 

 

Is there suppose to be sound in that video? Tried to watch it but not hearing anything.

Userlevel 1
Badge

yeah it does not have any sound , just trying to show you the settings i have , but still it is not showing any featured image in my (site B)

Userlevel 3
Badge +1

So your trigger is a new post in one wordpress site -

 

When you set that up, I assume you have tested the trigger. That test will pull in the sample data that you have access to in step 2. The only “featured image” you will have access to in step 2 that is custom data, is the featured image in step 1. 

Userlevel 1
Badge

you are correct , the featured image vaules appear in Trigger but in action it has (0) in frong of 

featured_media 0
 

 

Userlevel 3
Badge +1

Can you screenshot the setup in step 2 where you are setting featured image?

Userlevel 1
Badge

here are the setting 

 

Userlevel 7
Badge +11

Hey @jamesgerry,

I think what you’ll want to try here is to add an Upload Media WordPress action before the Create Post action. This will allow you to upload the feature image from site 1 to site 2. On that Upload Media action, you’d need to select the featured image’s URL from site 1 in the File field. That would look something like this: 
417e96dbc5f45f2317c389c0284f5f71.png
 

Then in the Create Post action you’ll then select the Custom option (from the Featured Media dropdown menu) and then choose the ID field. This should allow WordPress to use the image that was uploaded by the previous step. For example:

dfd7c2ddeb80baca76619e13d0f97cb6.png

Hope that helps, and please do keep us in the loop on how you get on with that! :)

Userlevel 1
Badge

i have setup the way you showed in the screenshot , should i select site (A) in Upload Media Field 

or Site B

as i have tested it on Site (A) selected in the Upload media 

and all the setting 

i am getting this 

 


settings
Action 

 

Userlevel 1
Badge

i have given the admin rights to the user , now i do not get any error and the test is also done good ,, but the featured images is sill not there in site B

Userlevel 7
Badge +11

Hey @jamesgerry,

Sorry for the delay in a response here! Glad to hear you were able to get rid of the 403 “Sorry, you are not allowed to create posts as this user” error by assigning them admin permissions. 

It looks as though the word “link” needs to be removed from the File field on step 2:

2089c5280936f311fb8d67d1b8e17bff.png

That said, looking at the URL in the field it doesn’t appear to be a direct link to the image file as I’m not seeing a .jpg or .png file extension at the end of it. Sorry for missing that previously! I did some further digging and it looks like a direct link to the featured image isn’t actually supplied by the WordPress integration. But, the good news is that we can get the URL of the featured image by adding a Webhooks by Zapier step. 

For the Webhook step you’d select the Custom Request action event and set up a GET request like so:
91df65f1aef09467cd62b613c66464e9.png

This then should result in the image URL being output in the guid rendered field:

2e00017502388893cc317ed7ce82d1b8.png

Next, you can select that field in the Upload Media step:

9c32ebf95ae1645edbdc6f5e44bf9ee1.png

As it’s a publicly accessible link to the featured image file it should have no trouble being uploaded to the second WordPress site. :)

Please do give that a try and let us know whether that does the trick! 

Userlevel 1
Badge

@SamB It Worked , Thanks alot you are indeed an expert, you just saved me a ton of work 
Really Appreciate it 

Userlevel 7
Badge +11

YAY! That’s fantastic news, @jamesgerry! I’m so glad that did the trick. :)