How to check if a theme is active?

You can use wp_get_theme: <?php $theme = wp_get_theme(); // gets the current theme if ( ‘Twenty Twelve’ == $theme->name || ‘Twenty Twelve’ == $theme->parent_theme ) { // if you’re here Twenty Twelve is the active theme or is // the current theme’s parent theme } Or, you can simply check if a function in twentytwelve … Read more

How to Link External jQuery/Javascript files with WordPress

From the wording of your question, you must be adding scripts by writing <script> tags in your template. Add your own scripts via wp_enqueue_script() in your template’s functions.php, appropriately setting dependences on jQuery, and wp_head() will add the scripts for you. function my_scripts() { wp_enqueue_script( ‘my-sweet-script’, get_bloginfo(‘template_directory’) . ‘/script.js’, array(‘jquery’) ); } add_action(‘template_redirect’, ‘my_scripts’); See … Read more

How to move the sidebar in TwentyFifteen to the right?

I took the following from the rtl.css and applied them via Magic Widget with additional !important keywords to an English site: body:before { right: 0 !important; left: auto !important; } .sidebar { float: right !important; margin-right: auto !important; margin-left: -100% !important; } .site-content { float: right !important; margin-right: 29.4118% !important; margin-left: auto !important; } .site-footer … Read more

Where can I sell WordPress themes and plugins? [closed]

here is a nice brake down for you: MarketPlaces Themes: Theme Forest – Probably the biggest theme marketplace by Evanto. Rates: New authors begin at the 50%. Templamatic – Rates: between 50% and 70%. BuyStockDesign – Rates: Start from 50% to 75%. BuySellWordpress – Rates: Starts from 50% and may go up to 70%. WPmart … Read more

How do I exclude plugins from getting automatically updated?

Instead of using the code from the question in functions.php, replace it with this: /** * Prevent certain plugins from receiving automatic updates, and auto-update the rest. * * To auto-update certain plugins and exclude the rest, simply remove the “!” operator * from the function. * * Also, by using the ‘auto_update_theme’ or ‘auto_update_core’ … Read more

theme path in javascript file

What you’re looking for is wp_localize_script function. You use it like this when enqueing script wp_register_script( ‘my-script’, ‘myscript_url’ ); wp_enqueue_script( ‘my-script’ ); $translation_array = array( ‘templateUrl’ => get_stylesheet_directory_uri() ); //after wp_enqueue_script wp_localize_script( ‘my-script’, ‘object_name’, $translation_array ); In your style.js, there is going to be: var templateUrl = object_name.templateUrl; …

Hide prices and checkout functionality in woocommerce

luckily woocommerce has many hooks, this removes prices and buttons: remove_action( ‘woocommerce_after_shop_loop_item’, ‘woocommerce_template_loop_add_to_cart’ ); remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_price’, 10 ); remove_action( ‘woocommerce_single_product_summary’, ‘woocommerce_template_single_add_to_cart’, 30 ); remove_action( ‘woocommerce_after_shop_loop_item_title’, ‘woocommerce_template_loop_price’, 10 ); you can dig into content-product.php and content-single-product.php if you need to remove more stuff. I can imagine there’s more than just the prices/buttons you want to … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)