WordPress
æ°ããWebãµã¤ãæ§ç¯ã«åãã¦ãç¾å¨WordPressãåå¼·ãã¦ãã¾ãã
æ¨æ¥ã¯ãã«ã¹ã¿ã æ稿ã¿ã¤ããã使ãäºã§ãèªå好ã¿ã®ã¡ã¤ã³ã³ã³ãã³ããè¨äºã¨ã¯å¥ã«ä½ãã話ãæ¸ãã¾ããã
ã§ãå®éã«ã¬ã³ã¿ã«ãµã¼ãã¼ã«ã¢ãããã¦ããWordPressã«ãã«ã¹ã¿ã æ稿ã¿ã¤ãããé©ç¨ãã¦ã¿ã¾ããã®ã§ããã®é©ç¨æ¹æ³ã¨å®éã®é©ç¨å¾ã®è¦æ ãçããä¼ããããã¨æãã¾ãã
ã¾ããã«ã¹ã¿ã ãã£ã¼ã«ããã¨å¼ã°ãããªãªã¸ãã«ã®æ稿é
ç®ã«ã¤ãã¦ãè¨å®ãã¦ã¿ã¾ããã®ã§ããã¡ããä½µãã¦è¨è¼ãã¾ãã
ã«ã¹ã¿ã æ稿ã¿ã¤ãã®é©ç¨
ã«ã¹ã¿ã æ稿ã¿ã¤ããWordPressã«å°å
¥ããã«ã¯èªåã§ãfunction.phpããæ¸ãæããäºã§ãå®ç¾ã§ãã¾ãããPHPã½ã¼ã¹ã®æ¹å¤ãããééãã¨WordPressãåããªããªã£ããã¨å¼å®³ã大ããã®ã§ãä»åã¯ãã©ã°ã¤ã³ã使ã£ã¦ã«ã¹ã¿ã æ稿ã¿ã¤ããå®ç¾ãã¾ãã
ã«ã¹ã¿ã æ稿ã¿ã¤ããå®ç¾ãããã©ã°ã¤ã³ã§ã¯ãCustom Post Type UIããä¸çªæåã§å®ç¸¾ãããã¾ãã®ã§ããã¡ãã使ãã¾ãã
å®éã®é©ç¨æã®å³ãè¼ããªããã«ã¹ã¿ã æ稿ã¿ã¤ããé©ç¨ãã¦ããã¾ãã
ãã©ã°ã¤ã³ãCustom Post Type UIããã¤ã³ã¹ãã¼ã«ããã
ãCustom Post Type UIãã®ã¤ã³ã¹ãã¼ã«å®äºã
ãCustom Post Type UIããæå¹åãã¾ããã
ããã¨WordPressã®å·¦å´ã®ã¡ãã¥ã¼ã«ãCPT UIãã¨ããé
ç®ã追å ããã¾ãã
ãCPT UIãã®ä¸ãããAdd/Edit Post Typesããé¸ã³ã¾ãã
ããã¨ãã«ã¹ã¿ã æ稿ã¿ã¤ããã®è¿½å ç»é¢ãåºã¦ãã¾ãã
å³å´ãè¨å®é ç®ã§ãã
çµæ§ãªè¨å®é
ç®æ°ãããã¾ãããã®è¾ºã¯ãSettingsãçã
ã¾ã è¨å®é
ç®ãç¶ãã¾ã(^^;ãåºæ¬ã¯ããã©ã«ãã®ã¾ã¾ã§ãè¯ãæ§ã§ãã
ã§ãå®éã«ãã«ã¹ã¿ã æ稿ã¿ã¤ãããè¨å®ãã¦ããã¾ãããï¼
ä»åã¯ãåæ±ååããæ³å®ãã¦ä½ã£ã¦ã¿ã¾ããããããããå
¥åãã¦ããã¾ãã
å³å´ã®ããã¹ã¦ã®é ç®ãã«ååãä»ããªãã¨ãå·¦ã®ã¡ãã¥ã¼ã§å¾ããåºã¦ããæã«ãAllåæ±ååãã¨ããååã«ãªã£ã¦ãã¾ãã®ã§ããããããæ¥æ¬èªãä»ãã¦ããã¾ãã
ãExclude From SearchããTrueã«å¤æ´ããã¨ãWordPressã®æ¤ç´¢ã§ãããããæ§ã«ãªãããã§ãã
ããã°è¨äºã ãã§ã¯ãªãã¦åæ±ååãæ¤ç´¢ã«ããããã¦æ¬²ããã®ã§ãTrueãã«å¤æ´ãã¾ãï¼ããã©ã«ãã¯Falseï¼ã
ããããã«ã¹ã¿ã æ稿ã¿ã¤ããè¨å®ãã¦ç»é²ããã¨ã»ã»ã»
å·¦ã®ã¡ãã¥ã¼ã«è¿½å ããã¾ããï¼ï¼ï¼
ããã°è¨äºãæ稿ããã ãã§ã¯ãªãã¦ããåæ±ååããã¼ã¿ãæ稿ã§ããæ§ã«ãªãã¾ãã(^-^)w
ããã¾ã§ã§ãã«ã¹ã¿ã æ稿ã¿ã¤ãããWordPressã«é©ç¨ããäºã«ãªãã¾ãã
ååã®æ稿ãã¹ã
ã§ã¯å®éã«è¿½å ããã«ã¹ã¿ã æ稿ã¿ã¤ãã使ã£ã¦ã¿ã¾ãããã
ã«ã¹ã¿ã æ稿ã¿ã¤ãã§ãããåæ±ååããæ°è¦è¿½å ãã¦ã¿ã¾ãï¼
ããã¨ãããªè¯ãè¦æ
£ããç»é¢ãåºã¦ãã¾ãã
ç©ã¯è©¦ãã§ãä»åèªãã§åå¼·ãã¦ããWordPressã®æ¬ãç´¹ä»ãã¦ã¿ã¾ãããï¼
- ä½è :ä¸å³¶ çæ´ã
- çºå£²æ¥: 2015/06/23
- ã¡ãã£ã¢: 大åæ¬
ä¸éãå
¥åãã¦ãå
¬éãããã¨ã»ã»ã»
æ稿ã§ãã¾ããï¼ï¼ï¼
æ®æ®µã®è¨äºãã³ãã¬ã¼ããé©ç¨ãããã¿ããã§ããããã®ã¾ã¾ã®è¨å®ã ã¨ã
æ稿ããä¸è¦§ã«ããã¡ãã¨è¡¨ç¤ºããã¾ãã(^^)w
æ®æ®µã®è¨äºã®æ稿ã¨ã¯åããã¦ç®¡çç»é¢ä¸ã¯è¦ãã¾ãããå®éã®DBä¸ã§ã¯åããã¼ãã«ã«ãã¼ã¿ã¯ä¿ç®¡ãããããã§ãã
ã«ã©ã ã®ï¼ã¤ãè¨äºã¯ãpostããåºå®ãã¼ã¸ã¯ãpageããã«ã¹ã¿ã æ稿ã¿ã¤ãã¯æ±ºãããPost Type Slugãã§ä¿åããã¾ãã
ä»åãªããitemãã¨ããååã§ãã¼ã¿ãç»é²ãããããã§ãã
ã«ã¹ã¿ã ãã£ã¼ã«ã
ããã¾ã§ã§ã«ã¹ã¿ã æ稿ã¿ã¤ãã¯ç»é²ãã¦å
¬éã¾ã§åºæ¥ã¾ãããããã®ã¾ã¾ã ã¨æ®éã®è¨äºã¨ç»é²åºæ¥ãå
容ãå¤ããã¾ããã
ãã£ããåå¥ã®ã«ã¹ã¿ã æ稿ã¿ã¤ããç»é²ãããã§ãããç¬èªã®ç»é²é
ç®ã追å ãããã¨ãããã®ã
WordPressã§ã¯ããããã«ã¹ã¿ã ãã£ã¼ã«ããã¨å¼ã³ããã©ã°ã¤ã³ã使ãäºã§ç°¡åã«è¿½å ããäºãåºæ¥ã¾ãã
ãã©ã°ã¤ã³ã¯ãAdvanced Custom Fieldãã¨ããç©ãå©ç¨ãã¾ãã
ãã©ã°ã¤ã³ãAdvanced Custom Fieldãã追å ãã¦æå¹åãã¾ãã
ããã¨WordPressã®ã¡ãã¥ã¼ã«ãã«ã¹ã¿ã ãã£ã¼ã«ããã¨ããé
ç®ã追å ããã¾ãã
ãã£ã¼ã«ãã°ã«ã¼ããæ°è¦è¿½å ãã¦ã¿ã¾ãã
ãä½ç½®ãâãã«ã¼ã«ãããæ稿ã¿ã¤ããçãããitemãã«å¤æ´ãã¾ãã
itemã¨ã¯ãã«ã¹ã¿ã æ稿ã¿ã¤ããã§é¸ãã ãPost Type Slugãã«ãªãã¾ãã
ããããpostãã«ããã°é常ã®ããã°è¨äºã«ãã«ã¹ã¿ã æ稿ã¿ã¤ããé©ç¨ããã¾ãã
ããã¦å®éã«åå¥ã«è¨å®ãããé
ç®ã1ã¤ãã¤è¨å®ãã¦ããã¾ããç»é¢ã¯ãåååãã§ãã
ãã£ã¼ã«ãã°ã«ã¼ããä½ãçµããã¾ããï¼ãåååãç»åãä¾¡æ ¼ãã¡ã¼ã«ã¼ããåå¥é
ç®ã¨ãã¦è¨å®ãã¾ããã
ããã¦å
ã»ã©ã®ãåæ±ååãã®ç·¨éã«ããã¨ã»ã»ã»
å
ç¨è¿½å ããã«ã¹ã¿ã ãã£ã¼ã«ããåºã¦ãã¾ããï¼
ããããå
¥åãã¦ã¿ã¾ãã
ããã¦æ´æ°ï¼
ã§ãå®éã«æ稿ãããã«ã¹ã¿ã æ稿ã¿ã¤ããè¦ã«è¡ãã¨ã»ã»ã»
ããï¼
æ¬æã ããæ®ã£ã¦ãã¦ãã«ã¹ã¿ã ãã£ã¼ã«ãã¯ã©ãã«ãåºã¦ãã¾ãã(^o^;
ã©ããå°ç¨ã®ã«ã¹ã¿ã ãã£ã¼ã«ã表示ç¨ã®ãã³ãã¬ã¼ããä½ã£ã¦ãããªãã¨è¡¨ç¤ºåºæ¥ãªãæ§ã§ã(-_-;
ãããã¯åå±ãå¸ããªãï¼ãã¨ããæã§æ¬æ¥ã¯ã¿ã¤ã ã¢ããï¼
é£ä¼æãã«ã¾ãé å¼µãã¾ã(^-^)/
ã¾ã¨ã
- ã«ã¹ã¿ã æ稿ã¿ã¤ããè¨å®ããã«ã¯ãfunction.phpããèªåã§æ¸ãæããæ¹æ³ã¨ããã©ã°ã¤ã³ãCustom Post Type UIãã使ãæ¹æ³ã¨ããã
- ãã©ã°ã¤ã³ã使ãã¨ã«ã¹ã¿ã æ稿ã¿ã¤ãã¯ç°¡åã«è¿½å ã§ããï¼
- ãã©ã°ã¤ã³ãAdvanced Custom Fieldãã使ãã¨ã«ã¹ã¿ã ãã£ã¼ã«ããç°¡åã«è¿½å ã§ããï¼
- ã«ã¹ã¿ã ãã£ã¼ã«ãã¯ãã³ãã¬ã¼ããç¬èªã®ç©ãæºåããªãã¨è¡¨ç¤ºãããªã(>_<)