• Resolved sera2007

    (@sera2007)


    Hi there
    First full, great thanks for your work and this plugin. It’s so useful for my project. I have one problem, I need to show some custom field instead of standard ones (Available Content Tags). Is there any way to do it ?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hi there!

    For features not built-in in WPP you’ll have to roll up your own custom HTML markup using either the wpp_custom_html filter hook or the wpp_post filter hook.

    For example:

    function customize_single_popular_post( $post_html, $p, $instance ){
    
            $my_custom_field = get_post_meta( $p->id, 'my-custom-field-key', true );
    
            $output = '<li><a href="' . get_the_permalink( $p->id ) . '" title="' . esc_attr( $p->title ) . '">' . $p->title . '</a> (' . $my_custom_field . ')</li>';	
    
            return $output;
    
    }
    add_filter( 'wpp_post', 'customize_single_popular_post', 10, 3 );
    Thread Starter sera2007

    (@sera2007)

    Great thanks for your solution!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show custom field on the widget’ is closed to new replies.