How can I insert an image map into a WordPress blog post?

yes, it should achievable like this .. <div> <img class=”alignnone” id=”imageMaps” src=”http://businessplumbing.com/wp-content/uploads/2011/11/Sloan-Royal-Flushometer.png” alt=”” width=”298″ height=”595″ usemap=”#flushometer” border=”0″ /> <map name=”flushometer” id=”flushometer”> <area shape=”rect” coords=”219,6,277,41″ href=”http://businessplumbing.com/products-page/lavatory-sink/sloan-royal-flushometer-a-72-cp-cover/” alt=”A-72 CP Cover” /> <area shape=”rect” coords=”218,42,278,70″ href=”http://businessplumbing.com/products-page/lavatory-sink/sloan-royal-flushometer-a-71-inside-cover/” alt=”A-71 Inside Cover” /> </map> </div> copy the whole code (including div) and paste in HTML tab in editor . the top … Read more

custom fields wordpress

The update_user_meta and get_user_meta functions are what you want, without having to fool around with any database connections or SQL. All it takes is one include statement in your theme, and a bit of PHP magic to call the meta functions. Check out my code, which accomplished what you are trying to do, on Github … Read more

Using the echo command adds unwanted br tags to source

If this is plugin code there is NO REASON the theme would make a difference. My guess is it’s a server issue (outputting of /n) or a WordPress function that changes the /n into <br> I would check wpautop() as I find that sometimes it’s this functions fault. See this post on the WordPress.org forum … Read more

Ajax Dynamic Archives not showing correct results

this is what i ended up with which works nicely. functions.php part <?php function scripts_enqueue() { if(is_page(‘archives’)) { wp_enqueue_script(‘ajax_dropdown’, get_stylesheet_directory_uri() . ‘/js/loadposts.js’,array(‘jquery’)); wp_localize_script( ‘ajax_dropdown’, ‘myajax’, array(‘custom_nonce’ => wp_create_nonce(‘nonce-ajax-dropdown’), ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ ) ) ); } } add_action( ‘wp_enqueue_scripts’, ‘scripts_enqueue’ ); function wp_ajax_load_posts(){ if(!wp_verify_nonce( $_GET[‘_wpnonce’], ‘nonce-ajax-dropdown’)) die( ‘Go away!’ ); $args = array( ‘year’ => … Read more

Why write markup for index.php?

WordPress might extend the existing template hierarchy in a future version. Your users would get a blank page after an upgrade. So write at least the basic loop, header, footer and pagination. Another point: I use and see at the index.php usually as the default template. I treat its layout as the core concept and … Read more

WP_Query create html structure

Use the built in current_post and post_count vars with php’s modulus operator to check where you are in the loop and output markup at the appropriate time. if( $grid_loop->have_posts() ): echo ‘<div class=”row”>’; while( $grid_loop->have_posts() ): $grid_loop->the_post(); ?> <div class=”col-xs-3 box”> <p><?php the_title(); ?></p> </div> <?php // if this is the third post // and … Read more

Editor stripping out data attribute when saving

The “Text” editor is not an HTML editor. If you want to be able to edit raw HTML you will need to use some other editor, but that will probably limit your ability to use the visual editor for the content edited with it. The plugin you mentioned seems like good compromise. The other alternative … Read more

Converting HTML Template to WordPress Theme

As said, you should enqueue your style sheets like this in your functions.php in your theme: function adds_to_the_head() { // Our own unique function called adds_to_the_head wp_register_style( ‘custom-style-css’, get_stylesheet_directory_uri() . ‘/css/styles.css’,”,”, ‘screen’ ); // Register style.css wp_enqueue_style( ‘custom-style-css’ ); // Enqueue our stylesheet } add_action( ‘wp_enqueue_scripts’, ‘adds_to_the_head’ );