WordPress widget/sidebar dividers?
‘after_widget’ => ”, As far as I know, thats the best way to do it
‘after_widget’ => ”, As far as I know, thats the best way to do it
That caption shortcode is built into WordPress. It should generate the same markup for any theme, unless the theme or a plugin has unregistered it and registered a replacement. I don’t know if that is the case with your theme or with TwentyEleven. Look for ‘img_caption_shortcode’ in your theme files, probably functions.php. If your theme … Read more
The post_class filter is your friend. Just combine it with get_post_meta(). function wpse80098_filter_post_class( $classes ) { global $post; if ( ‘yes’ == get_post_meta( $post->ID, ‘_jsFeaturedPost’, true ) ) { $classes[] = ‘my-custom-css-class’; } return $classes; } add_filter( ‘post_class’, ‘wpse80098_filter_post_class’ ); Just replace my-custom-css-class with whatever class you want to apply to the post container in … Read more
The sizes are stored in the options table in the database, so you can grab values with get_option(‘large_size_w’); The values stored in the DB are: thumbnail_size_w thumbnail_size_h medium_size_w medium_size_h large_size_w large_size_h
I put the script in a external file // Excerpt word count function excerpt_count_js(){ wp_enqueue_script( ‘excerpt-word-count’, plugins_url( ‘excerpt_word_count.js’, __FILE__ ), array( ‘jquery’ ), false, true ); } And modified the script a bit jQuery(document).ready( function($){ $(“#postexcerpt .handlediv”) .after(“<div style=\”position:absolute;top:2px;right:5px;color:#666;\”><small>Excerpt length: </small><input type=\”text\” value=\”0\” maxlength=\”3\” size=\”3\” id=\”excerpt_counter\” readonly=\”\” style=\”background:#fff;\”> <small>word(s).</small></div>”); $(“#excerpt_counter”).val($(“#excerpt”).val().split(/\S+\b[\s,\.\’-:;]*/).length – 1); $(“#excerpt”).keyup( function() { … Read more
Solved. I had a typo – line 10: $post_object = get_field(‘post_object’); should have had the name of my post object field ie: $post_object = get_field(‘myfieldname’);
You can use a Custom Walker to add attributes to the menu items. Basically, you add a parameter ‘walker’ to the wp_nav_menu() options and call an instance of an enhanced class: wp_nav_menu( array ( ‘menu’ => ‘main-menu’, ‘container’ => FALSE, ‘container_id’ => FALSE, ‘menu_class’ => ”, ‘menu_id’ => FALSE, ‘depth’ => 1, ‘walker’ => new … Read more
There is no performance difference, because the result of get_bloginfo() comes from an internal cache anyway, because most (all?) of the return values come from get_option() calls, and these are cached internally with wp_cache_set() and fetched with wp_cache_get(). See Exploring the WordPress Cache API. Even if there would be a difference it would be too … Read more
Debug it logically. This code works. I just tested it. This in a theme (I put it in header.php for testing): jQuery(document).ready(function() { var lanid = ‘demo’; var ajaxurl=”<?php echo admin_url(“admin-ajax.php”, null); ?>”; data = { action: “get_ldapattr”, lanid: lanid}; jQuery.ajax({ url: ajaxurl, data: data, dataType: ‘json’, type: ‘post’, success: function(response) { console.log(response); } }); … Read more
When you load a php file directly via an ajax request (UncheckPackageThemeHelper.php) it’s loaded outside the context of WordPress, so no WordPress core functions are available. All WordPress ajax requests should be routed through admin-ajax.php. You can print the URL with the function admin_url: admin_url( ‘admin-ajax.php’ ) When admin-ajax.php is loaded, WordPress is bootstrapped, so … Read more