WordPress Google Maps in Custom Theme

Enqueue your script and use wp_localize_script to pass data. function wpd_scripts() { wp_enqueue_script( ‘wpd_script’, get_stylesheet_directory_uri() . ‘/js/script.js’, null, null, false ); wp_localize_script( ‘wpd_script’, ‘WPD’, array( ‘stylesheet_dir’ => get_stylesheet_directory_uri() ) ); } add_action( ‘wp_enqueue_scripts’, ‘wpd_scripts’ ); You can then use WPD.stylesheet_dir in your script to get the value you set in PHP. var marker_url = WPD.stylesheet_dir … Read more

Style.css redirects to 404 Page not found

Your directory permissions for your Theme directory are incorrect. wp-content: 0755 wp-content/themes: 0755 wp-content/themes/kenchristy: 0700 Per the Codex, folder permissions should be set to 755: In such an suexec configuration, the correct permissions scheme is simple to understand. All files should be owned by the actual user’s account, not the user account used for the … Read more

Get last modified date for menu link

The nav_menu_link_attributes filter can be used to accomplish this, so a walker is not necessary. Here’s an example with comments along the way to explain what’s happening. add_filter( ‘nav_menu_link_attributes’, ‘wpse_nav_menu_link_attributes’, 10, 4 ); /** * Filters the HTML attributes applied to a menu item’s anchor element. * * Adds data-modified attribute to links. * – … Read more

How to handle thumbnails

Since WordPress 2.9, you can add thumbnail support to your theme by adding this to the theme’s functions.php file: if ( function_exists( ‘add_theme_support’ ) ) { add_theme_support( ‘post-thumbnails’ ); } When this is done, you’ll be able to add a feature image to your post on Posts, Pages or Custom Post Types. You’ll see the … Read more

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