I’d like to add a line of html code to one of the bb modules but I want to know what the best way to do it to make sure it stays there even when the bb plugin gets updated. Please advise.
It might be easier for me to provide a solution if you show me what you’re trying to add and where. Let me know and we’ll go from there.
I simply want to add a shortcode to display sharing options at the end of each post (using the shareaholic plugin), basically its just a small line of code but I wanna make sure it doesn’t get deleted when the plugin is updated. Can it be tied to the theme somehow?
<?php echo do_shortcode(’[shareaholic app=“share_buttons” id=“21325164”]’); ?>
That would be placed on your theme files, not on the plugin. If you want it on all posts, you can place that code on your
single.php file in a child theme so it doesn’t get lost when you update the theme.
I’ve played with that plugin before, there should be an option to attach the social link buttons at the bottom of every Post so you don’t really have to edit anything or am I missing something?
Modifying single.php doesn’t affect the Post module, for instance, if I add the post module to a random page (like the homepage) I don’t get the share options by default, only if I add the shortcode to the module files which will get deleted on the next plugin update
I would like to know what the best practice to modifying a module file without getting the change overridden when updating t he plugin is, I don’t want to do deep changes, just simple things like this. Please advise.
The only way to currently modify core modules without having your changes disappear in an update is by overriding them in your theme. You can read more about that here…
Let me know if you have any questions!
perfect! this is what I needed thank you so much !!!
quick question, does the entire module (all files) need to be there or only the file that I am overriding ?
The entire module folder needs to be copied over at this time.
ok got you ! thank you!!!
You’re welcome, Carlos!