wp_nav_menu, add class to every nth item?
You can use jQuery to do that. Try this in your header : $(document).ready(function() { $(“#mymenu li:nth-child(3n+3)”).addClass(“last”); }); Note : for this to work you need to have enqueued jQuery.
You can use jQuery to do that. Try this in your header : $(document).ready(function() { $(“#mymenu li:nth-child(3n+3)”).addClass(“last”); }); Note : for this to work you need to have enqueued jQuery.
Why not just create a few shortcodes for what you need? you can create columns for all kind of uses,, add this to your themes function.php file.. <?php function yourtheme_one_third( $atts, $content = null ) { return ‘<div class=”one_third”>’ . do_shortcode($content) . ‘</div>’; } add_shortcode(‘one_third’, ‘yourtheme_one_third’); function yourtheme_one_third_last( $atts, $content = null ) { return … Read more
I’m using Tom McFarlin’s Plugin Boilerplate for the plugins I write and in the main plugin file, there is a conditional statement to keep things as light as possible in the admin: if ( is_admin() && ( ! defined( ‘DOING_AJAX’ ) || ! DOING_AJAX ) ) { … } Since the Quick Edit feature uses … Read more
The 10 is the priority, 2 means that two variables are passed on to the function ( $column, $post_id ). I think the problem is trying to echo get_post_meta directly. Try this: function custom_employee_column( $column, $post_id ) { switch ( $column ) { case ‘location’ : $metaData = get_post_meta( $post_id , ‘location’ , true ); … Read more
There is no filter for this column. So answer is ‘No’. WP_List_Table search for method column_{something} inside class of Lister. Comments List class has column_author. So kill this column, and create filter as you do now.
The problem is that by setting the posts to be ordered by _start_event_datetime you’re creating the implicit assumption that the post will have that meta. This means the SQL query WordPress generates will only fetch posts of your custom post type with that meta. There are two possible solutions to this: Replace your current query … Read more
See the follow-up post: http://scribu.net/wordpress/sortable-taxonomy-columns.html
The code from ThinkVitamin is right. I think the problem came from else where in your code. Actually, the hook manage_edit-${post_type}_columns takes an argument $columns which is an array of all registered columns. To add a new column, just add a new element to this array, like this: add_filter(‘manage_edit-film_columns’, ‘my_columns’); function my_columns($columns) { $columns[‘views’] = … Read more
Why not just hide the column from view using CSS ? .column-yourcolumnname { display: none; }
Instead of adding your column label “view” as a string, pass it in as an array with 1 as the second value. Like this: array(‘view’,1) Full Code: add_filter( ‘manage_edit-post_sortable_columns’, ‘my_sortable_view_column’ ); function my_sortable_view_column( $columns ) { $columns[‘post_views’] = array(‘view’,1); return $columns; } I don’t have a WP Codex for this, but I found someone else … Read more