admin管理员组文章数量:1130349
My client bought a theme on themeforest and I need to customize it to add a like button on the top and bottom sections of to each blog post. I have decided to use this:
So far to develop HTML / CSS changes locally, I have uploaded the themeforest theme through the /wp-admin section and then updated the code accordingly and refreshed the page. This has worked.
Now I want to add the heart-this plugin, but I want to use the heart_this_hearts() template tags because I want the hearts to be in 2 specific locations.
However, if I just add the plugin as a dependency of the blog and not the theme itself, that means the theme wouldn't function by itself since it would be missing a plugin if I import it to another blog that doesn't have the hearts plugin.
My guess is that I should put it in this folder? /Users/edmundmai/Sites/mysite/wp-content/themes/mytheme ? But when I did that and refreshed the admin dashboard, it didn't show up in my list of plugins.
Do I just need to reupload the theme? Will I lose any data?
My client bought a theme on themeforest and I need to customize it to add a like button on the top and bottom sections of to each blog post. I have decided to use this: https://wordpress/plugins/heart-this/#description
So far to develop HTML / CSS changes locally, I have uploaded the themeforest theme through the /wp-admin section and then updated the code accordingly and refreshed the page. This has worked.
Now I want to add the heart-this plugin, but I want to use the heart_this_hearts() template tags because I want the hearts to be in 2 specific locations.
However, if I just add the plugin as a dependency of the blog and not the theme itself, that means the theme wouldn't function by itself since it would be missing a plugin if I import it to another blog that doesn't have the hearts plugin.
My guess is that I should put it in this folder? /Users/edmundmai/Sites/mysite/wp-content/themes/mytheme ? But when I did that and refreshed the admin dashboard, it didn't show up in my list of plugins.
Do I just need to reupload the theme? Will I lose any data?
Share Improve this question edited Dec 7, 2018 at 16:18 bigpotato asked Dec 7, 2018 at 16:12 bigpotatobigpotato 3352 gold badges6 silver badges17 bronze badges 1 |1 Answer
Reset to default 1You can add such dependencies using TGM plugin activation: http://tgmpluginactivation/
My client bought a theme on themeforest and I need to customize it to add a like button on the top and bottom sections of to each blog post. I have decided to use this:
So far to develop HTML / CSS changes locally, I have uploaded the themeforest theme through the /wp-admin section and then updated the code accordingly and refreshed the page. This has worked.
Now I want to add the heart-this plugin, but I want to use the heart_this_hearts() template tags because I want the hearts to be in 2 specific locations.
However, if I just add the plugin as a dependency of the blog and not the theme itself, that means the theme wouldn't function by itself since it would be missing a plugin if I import it to another blog that doesn't have the hearts plugin.
My guess is that I should put it in this folder? /Users/edmundmai/Sites/mysite/wp-content/themes/mytheme ? But when I did that and refreshed the admin dashboard, it didn't show up in my list of plugins.
Do I just need to reupload the theme? Will I lose any data?
My client bought a theme on themeforest and I need to customize it to add a like button on the top and bottom sections of to each blog post. I have decided to use this: https://wordpress/plugins/heart-this/#description
So far to develop HTML / CSS changes locally, I have uploaded the themeforest theme through the /wp-admin section and then updated the code accordingly and refreshed the page. This has worked.
Now I want to add the heart-this plugin, but I want to use the heart_this_hearts() template tags because I want the hearts to be in 2 specific locations.
However, if I just add the plugin as a dependency of the blog and not the theme itself, that means the theme wouldn't function by itself since it would be missing a plugin if I import it to another blog that doesn't have the hearts plugin.
My guess is that I should put it in this folder? /Users/edmundmai/Sites/mysite/wp-content/themes/mytheme ? But when I did that and refreshed the admin dashboard, it didn't show up in my list of plugins.
Do I just need to reupload the theme? Will I lose any data?
Share Improve this question edited Dec 7, 2018 at 16:18 bigpotato asked Dec 7, 2018 at 16:12 bigpotatobigpotato 3352 gold badges6 silver badges17 bronze badges 1-
2
You shouldn't tie a theme to a plugin just for a little feature like that. Just check
function_exists()for the plugin function before using it in the template. Then the theme will work with or without it. – Jacob Peattie Commented Dec 7, 2018 at 16:33
1 Answer
Reset to default 1You can add such dependencies using TGM plugin activation: http://tgmpluginactivation/
本文标签: How do I add a plugin dependency to my customized theme
版权声明:本文标题:How do I add a plugin dependency to my customized theme? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749119528a2318763.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


function_exists()for the plugin function before using it in the template. Then the theme will work with or without it. – Jacob Peattie Commented Dec 7, 2018 at 16:33