get_option function

You are using get_option() wrong, first variant, so take another look at the get_option() documentation. Basically you can’t directly access an array element with the function, it just doesn’t support it. The second variant should be possible, but you need at least PHP 5.4 – if I’m not totally mistaken; I don’t know anything about … Read more

Google Maps not displaying in wordpress using Google Maps Javascript API

I was able to get this working after a bit of fiddling. Give the #map-canvas element a height (you can do this in CSS): <div id=”map-canvas” style=”height:500px”></div> Add the callback argument to the google-maps script URL and add the defer and async attributes to the google-maps script tag. Also make custom-scripts a dependency for google-maps: … Read more

Custom theme/plugin update checks

There is no native mechanism for WP to check for updates from non-official resources. Some plugins/theme have such functionality of their own for themselves. If you want to implement such checks for arbitrary plugins/themes (coded without such in mind) it is not impossible, but will take loads of custom code and handling different possible sources … Read more

How to execute conditional script when on new customize.php (Theme Customize) screen

Okay, first, let’s set things up properly, with a callback hooked into an appropriate action hook: <?php function wpse55227_enqueue_scripts() { // Enqueue code goes here } add_action( ‘wp_head’, ‘wpse55227_enqueue_scripts’ ); ?> We’ll put all of our code in to this callback. The next step is to add our if ( ! is_admin() ) conditional wrapper: … Read more

Posts in multiple Categories different single.php

Instead of making it category specific you could use post formats and use different content-templates. In single.php you can write <?php get_template_part( ‘content’, get_post_format() ); ?> Then create different post formats add_theme_support( ‘post-formats’, array( ‘withpictures’, ‘withcomments’ ) ); Then create different post templates content-withpictures.php, content-withcomments.php When creating content the chosen post format will determine the … Read more

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