Articles of columns

Output column number according to active sidebars

$sidebars = array( is_active_sidebar( ‘footer-4’ ), is_active_sidebar( ‘footer-3’ ), is_active_sidebar( ‘footer-2’ ), is_active_sidebar( ‘footer-1’ ), ); $col = 0; foreach ( $sidebars as $sidebar ) { if ( $sidebar ) { $col++; } } echo ‘col-‘.$col.”; What i am trying to accomplish is have the correct number of WordPress active sidebars outputted. So that they […]

How to change gallery grid from 4 columns to 3 columns?

I’m using WordPress 4.2.2 running Gridsby Child theme (version:1.0.1436164618, latest update). I run my site locally using Xampp. My question: the Gridsby theme default homepage offers 4-column gallery grid. I would like to shrink the gallery container and to create a 3-column grid instead. I’m new to WP but I managed to make style changes […]

Make a custom column sortable by a value from a different custom post type

I’ve created some custom columns to display my custom post types more attractively in the admin section – the columns are mostly custom fields. Mostly, this works absolutely fine, and I can sort by the custom field columns as expected. However, one of the custom fields points to the post ID of a different post […]

Admin: how to make a custom list filter button send GET queryvars

I’ve setted custom columns for a custom post type, and I want to add a filtering functionality. I need to use custom data, so I can’t take advantage from things like wp_dropdown_categories and the like. My current code: // add select function add_filter_by_macroarea() { global $typenow; $post_type = ‘distributor’; $macroaree = array(‘italy’,’france’,’spain’,’world’); if($typenow == $post_type) […]

How to add columns to wordpress menu editor

Wondering if someone can point me in the right direction. Currently, I’m trying to figure out how to add columns and headings to sub menus. Naturally I want to create a basic megamenu where I can add titles with links inside elements. With list below the items. I’ve done a quick mockup on codepen of […]

Changer numbers of columns in woocommerce shop

I have a problem with my shop columns in WooCommerce. I would like to display 4 columns in my shop but unfortunately there is just 3 columns. I use the Storefront theme for my shop, so I have looked the storefront-template-fonction.php file and the different apply_filters are setting up on ‘columns’=>4. Exemple: $args = apply_filters( […]

Custom Columns for Custom Post Type Manager

Failing miserably at adding a custom column add_action(‘manage_edit-pricing_columns’, ‘manage_pricing_columns’); add_action(‘manage_pricing_posts_custom_column’, ‘manage_pricing_custom_columns’); function manage_pricing_columns($_columns) { $new_columns[‘cb’] = ‘<input type=”checkbox” />’; $new_columns[‘title’] = _x(‘Pricing Item’, ‘column name’); $new_columns[‘categories’] = _x(‘Type’, ‘column name’); $new_columns[‘date’] = _x(‘Created’, ‘column name’); return $new_columns; } function manage_pricing_custom_columns($column, $post_id){ global $post; switch($_columns) { case ‘categories’: $pt = get_the_terms( $post_id, ‘pricing_type’ ); echo $pt[0]->name; […]

How to add Edit | Delete button on rows?

I want to render columns with actions. When hover on row, Edit | Delete links show. Problem at function column_name($item). I don’t know why don’t run to this function. I tried to add wp_die() into this function but don’t have anything change. I written class extend WP_List_Table: class Custom_Table_Example_List_Table extends WP_List_Table { function __construct() { […]

Add custom column for custom field

I created a custom field bookcode using the code below. So, how I can add a column for this meta data into my post type manager and make it sortable? function save_bookcode( $post_id ) { if ( wp_is_post_revision( $post_id ) ) return; // save custom field ‘bookcode’ as CFX+ID add_post_meta( $post_id, ‘bookcode’, ‘CFX’ . $post_id, […]

User sort by role administrator area

I am looking on all the internet but I can’t find the answer. I want to add a column in the users administrator list to sort by user role. I don’t know programming and i can’t find a plugin (Admin Columns pro don’t do this). I know for sure it’s a simple function to the […]