How to automatically create an index of child sites at the root url for a multisite installation?

For create the links to your child sites use this function elenco_sotto_siti(){ global $wpdb; $blogs = $wpdb->get_results( $wpdb->prepare(“SELECT * FROM $wpdb->blogs WHERE public=”1″ AND archived=’0′ AND mature=”0” AND spam=’0′ AND deleted=’0′ ORDER BY blog_id “),ARRAY_A ); return $blogs; } For question 2 and 3, i use the option framework plugin, and i grab the description … Read more

how can i show a google map in custom post type

$prop_mapaddress contains your textfield value: <?php if(isset($prop_mapaddress)) { global $post; global $wpdb; $fromat_address = trim($prop_mapaddress); $fromat_address = str_replace(” “,”+”,$fromat_address); $address_obj = file_get_contents(“http://maps.googleapis.com/maps/api/geocode/json?address=”.$fromat_address.”&sensor=false”); $address_obj =json_decode($address_obj); $latitude = $address_obj->results[0]->geometry->location->lat; $longitude = $address_obj->results[0]->geometry->location->lng; ?> <script> var geocoder; var map; var lat = “<?php echo $latitude ?>”; var lng = “<?php echo $longitude; ?>”; function initialize() { geocoder = … Read more

Understanding WordPress Search

The default search is handled by WP_Query mostly by a method called parse_search(), which is triggered by the s parameter. You can search the source of WP_Query for is_search and piece together a few other bits and pieces. Or you can just create a query… $s = new WP_Query(array(‘s’ => ‘test’)); … dump the SQL… … Read more

create dynamic google map with iframe api

Step one: Familiarize yourself with Google Maps Embed API; and sign up for API key: The iframe embed option, unlike the Javascript API, does not have usage limits but does not have as many options/features. Determine which MODE you require and observe the required url format and parameters. Step two: Collect address from user. For … Read more

Where to paste Google Map Snippet / JavaScript / CSS for WordPress integration

The JS in the fiddle should be saved to a file, for example, scripts.js. If this was in a folder in the theme root called js you could enqueue the scripts like so: function add_wp_scripts() { wp_enqueue_script( ‘google-maps’, ‘https://maps.googleapis.com/maps/api/js’, array(), null, null ); wp_enqueue_script( ‘script’, get_template_directory_uri() . ‘/js/script.js’, array(), null, true ); } add_action( ‘wp_enqueue_scripts’, … Read more

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