最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

custom post types - overwrite function in parent theme function.php via child theme

programmeradmin1浏览0评论

I am trying to create portfolio page using custom post types in child theme. Here's the my site with 'work' page I am trying to convert using custom post types. I found this tutorial however it is for a parent theme. The tutorial uses pluggable function to add theme support for post thumbnails

if ( function_exists( 'add_theme_support' ) ) { 
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 280, 210, true ); // Normal post thumbnails
add_image_size( 'screen-shot', 720, 540 ); // Full size screen

However my parent theme (twentysixteen) already has such function which is not pluggable

add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size( 1200, 9999 );

My question is what would be the correct way to go about child theme in terms of incorporating the above? Should I wrap in if ( function_exists statement the parent theme function since I am looking to be able to overwrite it via child them functions.php?

发布评论

评论列表(0)

  1. 暂无评论