Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5530

blondishnet on "Mass insert thumbnail to posts via MySQL"

$
0
0

I have a site that has 300 posts that do not have an assigned thumbnail to them. I do not want to put a PHP statement for featured thumbnail on the front end, but be able to use 1 thumbnail image (like default-featured-thumbnail.jpg )

Now, I know if I load it to the media library, WordPress will attach a number to it (meta_id)... so I also know that number will be the one I want to mass insert into posts that do not have an assigned thumbnail (meta key is _thumbnail_id in the wp_postmeta). However, I also see that I need to have post_id

I am trying to wrap my head around a code to do this and thought I would pick anyone's brain to be able to come up with a code that runs the query that will do this.


Viewing all articles
Browse latest Browse all 5530

Trending Articles