I have been asked to alter the theme style of all of my blog posts as the style i have been using for all my posts has caused a conflict with googles adsense policy. Is there a quick way for me to change the theme of all posts at once or am i going to have to go to each post one at a time and update the style?
I have explicitly selected the style for all posts, so changing the default one isnt going to have any affect on all of the posts.
I have strong knowledge of PHP so i can write a script to do it if there is no easier way around it. I just need to know what i need to update.
-
This topic was modified 10 years by
dano1066.
Hi,
You can comment this line – http://screencast.com/t/CtlZ87O8a8 and remove or comment this code – http://screencast.com/t/Aukc0qt5FJ8
First please make a backup of your current file and note that if you make this modifications the individual post template will have no effect – http://screencast.com/t/XXmwrVnXt
I guess you can do this also from your database, so the theme settings will not be affected, unfortunately I cannot provide a quick solution for this.
Thanks!
Hey, thanks for the response. This was very helpful. I wanted to try and keep the theme code intact in case i ever wanted to change something for a specific post. Found this was very easily done through the database.
The theme setting for a post is stored in wp_postmeta. There is a key called “td_post_theme_settings” that contains the specific settings. By deleting this row, the post will revert to the global default. I ran the following command to clear the custom setting for every post.
DELETE FROM wp_postmeta WHERE meta_key LIKE ‘td_post_theme_settings’
Thanks for this post! I need to do this exact same thing now. I’m not the most familiar with SQL, so I was hoping you’d be willing to clarify where I would run this command at? My site is hosted and I believe that if I go into phpMyAdmin and enter the command under the SQL tab of my database for “Run SQL query/queries on database”, then that is what I need to do, correct?
Here’s a screenshot of the area I believe I need to enter this command into:
http://screencast.com/t/AVsLvGMnjFX
Do you think this is the correct place? Thanks!
-
This reply was modified 10 years by
ned4spd8874.
Hello ned4spd8874,
Maybe this will help: http://codex.wordpress.org/Database_Description#Table:_wp_postmeta
As dano1066 suggested will need to find and delete the meta-key “td_post_theme_settings” – http://screencast.com/t/VjIc4uqifm
I hope this helps.
Thank you!
@dano1066, what version of the theme are you running? When I try to run this via my SQL admin panel, I get an error saying that wp_postmeta doesn’t exist.
http://screencast.com/t/fmdaH8sTtY2
Nevermind, I’m running a wordpress hosted site and it turns out there is a unique string of characters in between the key, ex. wp_randomcharacters_postmeta. I was able t run the command as you suggested and things seem to be working now as far as the default theme setting goes. Thanks for posting this!
-
This reply was modified 10 years by
ned4spd8874.