PHP code on Visual Composer Plugin

So i found the answer with the help of Pieter Goosen and i would like to share it with you: A good method will be to create a Shortcode. To do it, just go to your template Functions.php file and create your function like this example: function shortcode_hello( $atts ){ $time = ( date(‘G’) < … Read more

Change the path where wordpress plugins are uploaded

You can change the Plugins directory using constants defined in wp-config.php: Set WP_CONTENT_DIR to the full local path of this directory (no trailing slash), e.g. define( ‘WP_CONTENT_DIR’, $_SERVER[‘DOCUMENT_ROOT’] . ‘/blog/wp-content’ ); Set WP_CONTENT_URL to the full URI of this directory (no trailing slash), e.g. define( ‘WP_CONTENT_URL’, ‘http://example/blog/wp-content’); Set WP_PLUGIN_DIR to the full local path of … Read more

How to tell if Jetpack’s Photon is active?

We just committed a new function to Jetpack Trunk, and it should be enabled in the next release, Jetpack::is_module_active() — http://plugins.trac.wordpress.org/changeset/716884 Then you can just call: if( class_exists( ‘Jetpack’ ) && Jetpack::is_module_active( ‘contact-form’ ) ) {} Or at least, you will once the next version releases, and the user has their Jetpack updated. 🙂 If … Read more

Add a subitem to Woocommerce section

Short answer, use: $args = array(‘show_in_menu’ => ‘woocommerce’); register_post_type(‘my_posttype’, $args); But this won’t give you the custom post type submenus. You can also use add_submenu_page, the code below is just an example: function register_my_custom_submenu_page() { add_submenu_page( ‘woocommerce’, ‘My Custom Submenu Page’, ‘My Custom Submenu Page’, ‘manage_options’, ‘my-custom-submenu-page’, ‘my_custom_submenu_page_callback’ ); } function my_custom_submenu_page_callback() { echo ‘<h3>My … Read more

Add Plugins to WordPress Theme

Let me make a recommendation: do not bundle plugins with your theme! On first glance, yes this is a very easy way to add default functionality with your theme, but there are a slew of reasons not to include the plugins this way: Updates: If the plugin is freely available from WordPress.org already, then so … Read more

How can I bulk edit variations in woocommerce? [closed]

The only solution I’ve found for mass updating variations that all have different prices is to get an extension / plug in that allows you to export the data to a spreadsheet file format, then make the desired changes to the file using a spreadsheet program, and then import the modified spreadsheet. The Woo Commerce … Read more

Pluggable function and activation check?

Don’t do the check on activation? Seriously, the best way I can think of is not to check for this on activation, but only in the normal plugin load process. And instead of throwing a warning (I assume you mean a PHP E_WARNING), perhaps putting an admin error box up would make more sense.

Sending all emails using SMTP

You are trying with your Gmail mail server and it’s blocked from Gmail not form your host. Enable Gmail less secure apps into your Gmail account. If you want to allow access anyway, follow these steps: 1) Go to the Less secure apps section of your Google Account. 2) Turn on Allow less secure apps. … Read more

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