Possible to display other information other than title and description

Is it possible to display post date and possibly applicable categories with this plugin? If not as standard could we add to plugin functionality by adding custom code and what is the best approach to this so plugin upgrades/patches do not break any custom code.

  • Ash
    • WordPress Hacker

    Hello Ed

    Please go to /wp-content/plugins/recent-posts/recent-posts.php and put the following at line no 93:

    $html .= '<br><span>' . date_i18n( get_option( 'date_format' ), network_get_post_time() ) . '</span>';
    $categories = network_get_the_category();

    $temp = array();
    foreach( $categories as $cat ) array_push( $temp, $cat->name );

    $html .= '<br>Category: ' . implode( ',', $temp );

    Like the following screenshot:

    Currently, you have to modify the code directly I am afraid. So, please note down the changes, and apply again when the plugin will be updated.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,

    Ash

  • Ed
    • WPMU DEV Initiate

    Hi Ash

    Thanks for this, I am a bit concerned as line 93 in my /wp-content/plugins/recent-posts/recent.posts.php file looks very different to your screenshot.

    Are you sure my recent-posts.php should look like the one in your screen shot?

    Thanks

    Ed

  • Ash
    • WordPress Hacker

    Hello Ed

    Looks like your FTP client is adding an extra line after each line. Please download the attached zip, unzip and overwrite the current file. Also keep a backup of your current file before uploading.

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,

    Ash

  • Ed
    • WPMU DEV Initiate

    Hi Ash

    Your category change worked thanks. Once more question, is it possible from within this section of code to pull through the relevant multi site blog site title that the recent post belongs to?

    Thanks again,

    Ed

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.