WordPress.org

Support

Support » How-To and Troubleshooting » Portfolio and "recent posts" widget

Portfolio and "recent posts" widget

  • Hi. Is there a way I can have the recent posts widget show the title of the posts from my portfolio (set up with custom post type) instead of my blog?

Viewing 5 replies - 1 through 5 (of 5 total)
  • there are several tutorials on how to create your own widgets, in this case all you really want to do is copy the recent posts widget and modify it appropriately to choose the correct post_type.

    you can copy the code from wp-includes/default-widgets.php

    search for:

    /**
     * Recent_Posts widget class
     *
     * @since 2.8.0
     */

    copy everything between that and:

    /**
     * Recent_Comments widget class
     *
     * @since 2.8.0
     */

    paste it into your functions.php for your theme (or another file which you include), and make the appropriate modifications.

    Thanks luckdragon but being new to wordpress, I can’t find the post_type I need to change amongst all that code. Any chance you might be able to point it out?

    when you click on “portfolio” on your admin menu it should take you to a url like

    wp-admin/edit.php?post_type=<something>

    whatever that <something> is, is the post type you need.

    Thanks a million!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Portfolio and "recent posts" widget’ is closed to new replies.