wordpress拿掉attachment_id或改為亂碼? - 部落格

By Ina
at 2013-09-13T18:39
at 2013-09-13T18:39
Table of Contents
※ 引述《hit1205 (幫你把勇氣裝滿)》之銘言:
: 推 hit1205:你可以在佈景主題裡判斷 is_attachment() 是否為 true 05/26 21:29
: → hit1205:如果是 false 就不顯示東西出來 05/26 21:29
: → hit1205:說錯,true 就不顯示東西出來 05/26 21:29
: → hit1205:然後可以用 $user_ID 存不存在來判斷是否登入 05/26 21:31
: → Danielgau:感謝樓上大師,我都忘了你就是用wordpress XD 05/26 21:49
: 我說詳細一點好了...
: WordPress 本身有一系列 is_ 開頭的函式
: http://codex.wordpress.org/Function_Reference
: 這類函式可以判斷目前是單篇文章頁還是首頁
: 是分類還是標籤,而附件頁的判斷方式是 is_attachment()
: 當目前的頁面是附件頁的時候,is_attachment() 會是 true
: 可以在這個時候不要顯示 the_content();
: 又或者,你的佈景主題裡如果有個 attachment.php 的話
: 那就直接改 attachment.php
: 把裡頭的 the_content(); 去掉
: 如果你要判斷有登入才顯示的話
: 可以用 if($user_ID){the_content();}
不好意思 有些看不懂
不想外網從媒體庫 翻資料
在WORDPRESS資料夾attachment.php檔
找不到 the_content()
目前的版本為 3.6版
--
: 推 hit1205:你可以在佈景主題裡判斷 is_attachment() 是否為 true 05/26 21:29
: → hit1205:如果是 false 就不顯示東西出來 05/26 21:29
: → hit1205:說錯,true 就不顯示東西出來 05/26 21:29
: → hit1205:然後可以用 $user_ID 存不存在來判斷是否登入 05/26 21:31
: → Danielgau:感謝樓上大師,我都忘了你就是用wordpress XD 05/26 21:49
: 我說詳細一點好了...
: WordPress 本身有一系列 is_ 開頭的函式
: http://codex.wordpress.org/Function_Reference
: 這類函式可以判斷目前是單篇文章頁還是首頁
: 是分類還是標籤,而附件頁的判斷方式是 is_attachment()
: 當目前的頁面是附件頁的時候,is_attachment() 會是 true
: 可以在這個時候不要顯示 the_content();
: 又或者,你的佈景主題裡如果有個 attachment.php 的話
: 那就直接改 attachment.php
: 把裡頭的 the_content(); 去掉
: 如果你要判斷有登入才顯示的話
: 可以用 if($user_ID){the_content();}
不好意思 有些看不懂
不想外網從媒體庫 翻資料
在WORDPRESS資料夾attachment.php檔
找不到 the_content()
目前的版本為 3.6版
--
Tags:
部落格
All Comments

By Caroline
at 2013-09-18T17:27
at 2013-09-18T17:27

By Christine
at 2013-09-23T01:23
at 2013-09-23T01:23
Related Posts
輕鬆搬家功能可自選要搬哪些東西嗎?

By Ophelia
at 2013-09-13T18:02
at 2013-09-13T18:02
匯入無名

By Anthony
at 2013-09-12T22:32
at 2013-09-12T22:32
大家無名的照片都轉到哪裡呢?

By Joseph
at 2013-09-12T13:45
at 2013-09-12T13:45
雅虎搬到隨意窩 還要多久時間?

By Edward Lewis
at 2013-09-12T12:58
at 2013-09-12T12:58
出現「您已從其他位置登出」錯誤訊息

By Carolina Franco
at 2013-09-11T22:41
at 2013-09-11T22:41