What happens if I don’t update my plugins?

I personally disable all updates; themes/plugins/core, too many times I was burned with erros in the most inconvenient times possible. Now I do manual updated for each site after I checked in a development environment. after im sure that everything works and I fixed every bug that happened I update the live site. Now I … Read more

Woocommerce: how to change ‘Cart Updated’ message [closed]

WooCommerce is heavily localised, so you can make use of WordPress’ localisation functions to change its messages. add_filter(‘gettext’, ‘wpse_124400_woomessages’, 10, 3); /** * change some WooCommerce labels * @param string $translation * @param string $text * @param string $domain * @return string */ function wpse_124400_woomessages($translation, $text, $domain) { if ($domain == ‘woocommerce’) { if ($text … Read more

How to use is_single and get_post_type within a plugin?

You need to hook into an appropriate place within the WordPress load sequence. For example, add_action(‘init’, ‘my_function’); //is too early and won’t work! Where as, add_action(‘wp’, ‘my_function’); //will work! And so too will, add_action(‘template_redirect’, ‘my_function’); //this works too! In fact template_redirect fires just before rendering the page/post to the viewer so its an appropriate place … Read more

WordPress 4.8.1 php getting commented

As I mentioned in the comments, you should not and also can not use codes inside your content. Any code tags that you use will be escaped. Instead, define a shortcode in your theme’s functions.php file and use that inside your content. Let’s create a simple shortcode together: function create_shortcode( $atts ) { // Create … Read more

How to create a child/addon plugin

Personally I’d either write my own plugin with a if plugin x exists clause or just edit it and send the code off to the developer saying “I have added a feature to your plugin, hope you like it” kinda deal. Realistically though, in my own site I just edit the code and be done … Read more

Problems With WP Bannarize Plugin [closed]

Try to use: Smart Slider / WP Booststrap Gallery Are great plugins for Banner, they are free, responsive and easy to adapt. Here’s an example of using SmartSlider with ShortCode: <section id=”secao-sliders-index”> <div class=”row”> <div class=”col-lg-12 col-xl-12″> <div id=”container”> <?php echo do_shortcode(‘[smartslider3 slider=2]’); ?> </div> </div> </div> <br> <div class=”row”> <div class=”col-lg-12 col-xl-12″> <div id=”container”> … Read more

How to create an option page for this simple plugin

Copy pate this below code in your functions.php file, <?php add_menu_page(‘BAW Plugin Settings’, ‘BAW Settings’, ‘administrator’, __FILE__, ‘baw_settings_page’, get_stylesheet_directory_uri(‘stylesheet_directory’).”/images/media-button-other.gif”); ?> <?php // create custom plugin settings menu add_action(‘admin_menu’, ‘baw_create_menu’); function baw_create_menu() { //create new top-level menu add_menu_page(‘BAW Plugin Settings’, ‘BAW Settings’, ‘administrator’, __FILE__, ‘baw_settings_page’,plugins_url(‘/images/icon.png’, __FILE__)); //call register settings function add_action( ‘admin_init’, ‘register_mysettings’ ); } function … Read more

Banner not visible after plugin publishing

The problem was : I generated images with Illustrator, I got this before saving the image : translation : “Some file names contains caracters no latin. These names won´t be incompativél with servers and Web browsers” The problem was, I copied the name from a Web page and that created a non latin caracter. When … Read more