Support » Fixing WordPress » Custom post type thumbnail (underscores theme)

  • I’ve been working on a new theme for my personal blog, and I decided to use the Underscores theme as my base. I had to add a custom post type for my portfolio, but I can’t seem to get the post thumbnail function working for my custom post type. I’ve enabled the post thumbnail function, and it works just fine for my posts and pages, but it won’t show up on the edit screen of my portfolio posts.

    I’ve tried this instead of the short function: add_theme_support( 'post-thumbnails', array( 'post', 'portfolio' ) );, but without luck.

    Any ideas what may be causing this problem? As stated earlier I’m using the Underscores theme. Thank you in advance!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Jarlund,

    Sorry to hijack your post, but I’m also using a theme based on Underscores, and I can’t get the Featured Image / Post Thumbnails function to work at all for any of my posts.

    The Functions php file contains the code ‘add_theme_support( ‘post-thumbnails’ );’ but in the comments within the file, it also says the following:

    * Note that this function is hooked into the after_setup_theme hook, which runs
    * before the init hook. The init hook is too late for some features, such as indicating
    * support post thumbnails

    Any suggestions please … or should I raise a separate query?

    Thanks,
    SN.

    I know this is an old post, but hopefully somebody else Googling this will find it useful.

    @jarlund – I’m also using the Underscores theme. I uncommented the line to add image thumbnail support, which added to the thumbnails to my posts and pages.

    To add it to my custom post types, I added a field to the custom post type ‘supports’ array:

    'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'custom-fields', 'comments', 'revisions', 'page-attributes' )

    Notice the new field ‘thumbnail’? I believe that fixed it.

    Hi Jeremy,

    Does Underscores support custom post types?

    The reason I ask is that I just installed a very popular WordPress calendar plugin on my Underscores site, and the events detail pages of this calendar are said (by the plugin authors) to be created as custom posts.

    The plugin authors go on to say that if the theme doesn’t support custom post types then ‘the events detail pages may not show up at all’.

    Well, this is exactly what I’m experiencing. I click on the event on the monthly calendar, and I get a page-not-found.

    Any help would be appreciated.

    Finally, if this question is too far off the topic, let me know, and I’ll do a new post with this question.

    Thanks,
    Alex

    @alexwp333 – yes it does support custom types. I use them on a few different sites of mine.

    the page not found error means you might need to re-generate the .htaccess file (after adding the custom post type). the easiest way to do this is by going to permalinks, and just clicking the save button again. that did the trick for me when I had a similar issue.

    good luck!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom post type thumbnail (underscores theme)’ is closed to new replies.