• Resolved moacirsantana

    (@moacirsantana)


    Hello, I’d like to add a custom column in the add listing on my admin page but it seems I’m unable to.

    I was using a plugin which added a custom visit counter column, the only post type that didn’t work was this, ‘advert’.

    I tried some other codes in the functions.php which also worked for the other post types but not for this one.

    Any ideas why? The custom field name is: love_visitas

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Greg Winiarski

    (@gwin)

    Hi,
    WPAdverts forces specific columns in the wp-admin / Classifieds / All Classifieds panel, but you still should be able to insert your own columns by setting a lower priority (so your code will run after WPAdverts code) in the code which adds the columns.

    One thing you can try is to set a higher priority for the WPAdverts functions (so you will not need to lower the priority in your code or the plugin you are using), you can do that with the code below

    
    add_action( "init", function() {
        remove_filter( 'manage_edit-advert_columns', 'adverts_edit_columns' );
        add_filter( 'manage_edit-advert_columns', 'adverts_edit_columns', 1 );
    }, 20 );
    

    If this will not help please paste the code you are using to insert a new column.

    Thread Starter moacirsantana

    (@moacirsantana)

    Yes it worked. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add a Custom Column’ is closed to new replies.