在我的WordPress的網站上,當我點擊我的投資組合類別,它顯示標題'博客檔案'這不是什麼我想要。WordPress的投資組合頁面使用標題'博客檔案',我想它說'投資組合'
我想要一個'Portfolio'的標題。所以我找到了archive.php的模板文件,它基本上說如果變量is_Day,is_Month或is_Year已設置,那麼顯示相關的存檔標題,否則顯示'Blog Archive',看下面的代碼
<h2>
<?php if (is_day()) : /* if the daily archive is loaded */ ?>
<?php printf(__('Daily Archives: <span>%s</span>'), get_the_date()); ?>
<?php elseif (is_month()) : /* if the montly archive is loaded */ ?>
<?php printf(__('Monthly Archives: <span>%s</span>'), get_the_date('F Y')); ?>
<?php elseif (is_year()) : /* if the yearly archive is loaded */ ?>
<?php printf(__('Yearly Archives: <span>%s</span>'), get_the_date('Y')); ?>
<?php else : /* if anything else is loaded, ex. if the tags or categories template is missing this page will load */ ?>
<?php _e('Blog Archive', 'theme5820'); ?>
<?php endif; ?>
</h2>
在我看來,投資組合頁面正在使用檔案模板來顯示帖子,因爲上面說'如果還有其他東西被加載,例如。如果標籤或類別模板丟失,該頁面將會加載'
所以我的問題是真的,只要將'Blog Archive'更改爲投資組合,或者我應該爲投資組合類別創建一個頁面投資組合頁面本身顯示標題正常。
乾杯,豐富:)