Recent Post Widget

resolved (5 posts) (2 voices)

  1. AlexBepunkt


    This might be a little out of the normal routine:

    Talking about the Recent Post Widget: I don't want to show visitors the date of recent posts. Instead the categories should come up. This works fine for posts.


    Now, when I add the widget to a page the category array is empty??


    Yes, I tweaked the code a little at widget-recent.php:

    $meta_output = '[post_terms taxonomy="category" text=' . __( 'in ', MYSITE_TEXTDOMAIN ) . '] ';
    /* $out .= apply_filters( 'mysite_widget_meta', do_shortcode( '[post_date]' ) );
    if( !empty( $meta_output ) )
    $out .= '<span class="post_neuer_beitrag">' . $meta_output . '</span>';
    echo apply_atomic_shortcode( 'post_meta', $out );

    /* echo $out; */

    Any idea how to fix this for static pages?


    Posted 5 years ago #
  2. Elliott

    Hello AlexBepunkt,

    You can add this,

    $out .= '[post_terms taxonomy="category" text="' . __( '<em>in</em>', MYSITE_TEXTDOMAIN ) . ' "] ';

    To display the categories.

    Posted 5 years ago #
  3. AlexBepunkt

    Hi Ellliot,

    That is quite similar to what I posted and gives me a "[post_terms taxonomy="category" text="in" in both post & pages?

    With the code above I was at least able to display the categories in posts. Still it doesn't work for posts...??

    Posted 5 years ago #
  4. Elliott

    Did you add it? You can also use this function to grab the category,

    Posted 5 years ago #
  5. AlexBepunkt

    Yes, I added the code you suggested. But as I said, it echos "[post_terms taxonomy="category" text="in" instead of the categories.

    But the function reference worked great !!

    Thanks for pointing in the right direction.

    Posted 5 years ago #


You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme