{"id":40186,"date":"2024-11-03T04:12:05","date_gmt":"2024-11-03T04:12:05","guid":{"rendered":"https:\/\/atmokpo.com\/w\/?p=40186"},"modified":"2024-11-26T06:39:51","modified_gmt":"2024-11-26T06:39:51","slug":"18-%eb%8d%b0%ec%9d%b4%ed%84%b0%eb%b2%a0%ec%9d%b4%ec%8a%a4%ec%99%80-%ec%bb%a4%ec%8a%a4%ed%85%80-%eb%8d%b0%ec%9d%b4%ed%84%b0-%ec%b2%98%eb%a6%ac-wp-query%eb%a5%bc-%ec%82%ac%ec%9a%a9%ed%95%9c-%ec%bb%a4","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/40186\/","title":{"rendered":"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30"},"content":{"rendered":"<p><body><\/p>\n<p>\n    \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc911\uc2ec\uc758 CMS(Content Management System)\uc73c\ub85c, \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud65c\uc6a9\ud558\uc5ec \ud3ec\uc2a4\ud2b8, \uc0ac\uc6a9\uc790, \ub313\uae00, \uc124\uc815 \ub4f1 \ub2e4\uc591\ud55c \ub370\uc774\ud130\ub97c \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \uc6cc\ub4dc\ud504\ub808\uc2a4\uc5d0\uc11c \ucee4\uc2a4\ud140 \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uacfc `WP_Query`\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \ubd88\ub7ec\uc624\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h2>1. \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc774\ud574\ud558\uae30<\/h2>\n<p>\n    \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \uae30\ubcf8\uc801\uc73c\ub85c MySQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4. \uae30\ubcf8 \ud14c\uc774\ube14 \uad6c\uc870\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:\n<\/p>\n<ul>\n<li><code>wp_posts<\/code>: \ud3ec\uc2a4\ud2b8 \ubc0f \ud398\uc774\uc9c0 \ub370\uc774\ud130 \uc800\uc7a5<\/li>\n<li><code>wp_users<\/code>: \uc0ac\uc6a9\uc790 \uc815\ubcf4 \uc800\uc7a5<\/li>\n<li><code>wp_comments<\/code>: \ub313\uae00 \ub370\uc774\ud130 \uc800\uc7a5<\/li>\n<li><code>wp_options<\/code>: \uc0ac\uc774\ud2b8 \uc124\uc815 \uc815\ubcf4 \uc800\uc7a5<\/li>\n<li><code>wp_postmeta<\/code>: \ud3ec\uc2a4\ud2b8\uc5d0 \ub300\ud55c \ucd94\uac00 \uba54\ud0c0\ub370\uc774\ud130 \uc800\uc7a5<\/li>\n<\/ul>\n<h3>1.1 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud14c\uc774\ube14 \uad6c\uc870<\/h3>\n<p>\n    \uac01 \ud14c\uc774\ube14\uc740 \uc5ec\ub7ec \uac00\uc9c0 \ud544\ub4dc\ub97c \uc815\uc758\ud558\uace0 \uc788\uc73c\uba70, \uadf8 \uc911\uc5d0\uc11c\ub3c4 \ud2b9\ud788 \uc8fc\uc758\ud574\uc57c \ud560 \uac83\uc740 <code>wp_postmeta<\/code> \ud14c\uc774\ube14\uc785\ub2c8\ub2e4. \uc774 \ud14c\uc774\ube14\uc740 \ud3ec\uc2a4\ud2b8\uc5d0 \ub300\ud55c \ucd94\uac00\uc801\uc778 \uc815\ubcf4\ub97c \uc800\uc7a5\ud558\ub294 \ub370 \uc0ac\uc6a9\ub429\ub2c8\ub2e4. \ucee4\uc2a4\ud140 \ud544\ub4dc\ub97c \ucd94\uac00\ud558\ub824\uba74 \uc774 \ud14c\uc774\ube14\uc5d0 \uc0c8\ub85c\uc6b4 \uba54\ud0c0\ud0a4\uc640 \uba54\ud0c0\uac12\uc744 \uc0bd\uc785\ud558\uba74 \ub429\ub2c8\ub2e4.\n<\/p>\n<h2>2. \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucd94\uac00\ud558\uae30<\/h2>\n<p>\n    \ucee4\uc2a4\ud140 \ub370\uc774\ud130\ub97c \ucd94\uac00\ud558\uae30 \uc704\ud574\uc11c\ub294 \ud3ec\uc2a4\ud2b8 \uba54\ud0c0(metadata)\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ud558\ub294 \uc815\ubcf4\ub97c \uc800\uc7a5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 `add_post_meta()`, `update_post_meta()`, `get_post_meta()` \ud568\uc218\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<h3>2.1 \ud3ec\uc2a4\ud2b8 \uba54\ud0c0 \ucd94\uac00 \uc608\uc81c<\/h3>\n<pre><code>\n$post_id = 1; \/\/ ID of the post\n$meta_key = 'custom_field';\n$meta_value = 'This is a custom value';\n\n\/\/ \uba54\ud0c0 \ucd94\uac00\nadd_post_meta($post_id, $meta_key, $meta_value);\n<\/code><\/pre>\n<h3>2.2 \ud3ec\uc2a4\ud2b8 \uba54\ud0c0 \uc5c5\ub370\uc774\ud2b8 \uc608\uc81c<\/h3>\n<pre><code>\n\/\/ \uba54\ud0c0 \uc5c5\ub370\uc774\ud2b8\nupdate_post_meta($post_id, $meta_key, 'Updated custom value');\n<\/code><\/pre>\n<h3>2.3 \ud3ec\uc2a4\ud2b8 \uba54\ud0c0 \ubd88\ub7ec\uc624\uae30 \uc608\uc81c<\/h3>\n<pre><code>\n\/\/ \uba54\ud0c0 \ubd88\ub7ec\uc624\uae30\n$custom_value = get_post_meta($post_id, $meta_key, true);\necho $custom_value; \/\/ \"Updated custom value\"\n<\/code><\/pre>\n<h2>3. WP_Query\ub97c \uc774\uc6a9\ud55c \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30<\/h2>\n<p>\n    `WP_Query` \ud074\ub798\uc2a4\ub294 \ud2b9\uc815 \uae30\uc900\uc5d0 \ub530\ub77c \ud3ec\uc2a4\ud2b8\ub97c \ucffc\ub9ac\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \ucee4\uc2a4\ud140 \ub370\uc774\ud130\uc640 \uba54\ud0c0 \ub370\uc774\ud130\ub97c \ucffc\ub9ac\ud560 \ub54c \ud2b9\ud788 \uc720\uc6a9\ud569\ub2c8\ub2e4.\n<\/p>\n<h3>3.1 WP_Query \uae30\ubcf8 \uc0ac\uc6a9\ubc95<\/h3>\n<pre><code>\n$args = array(\n    'post_type' =&gt; 'post', \/\/ \ud3ec\uc2a4\ud2b8 \ud0c0\uc785\n    'posts_per_page' =&gt; 10, \/\/ \ubd88\ub7ec\uc62c \ud3ec\uc2a4\ud2b8 \uac1c\uc218\n);\n\n$query = new WP_Query($args);\n\n\/\/ \ud3ec\uc2a4\ud2b8 \ub8e8\ud504 \uc2dc\uc791\nif ($query-&gt;have_posts()) {\n    while ($query-&gt;have_posts()) {\n        $query-&gt;the_post();\n        the_title('<h2>', '<\/h2>'); \/\/ \ud3ec\uc2a4\ud2b8 \uc81c\ubaa9 \ucd9c\ub825\n        the_content(); \/\/ \ud3ec\uc2a4\ud2b8 \ub0b4\uc6a9 \ucd9c\ub825\n    }\n} else {\n    echo '\ud3ec\uc2a4\ud2b8\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.';\n}\n\/\/ \ud3ec\uc2a4\ud2b8 \ub8e8\ud504 \uc885\ub8cc\nwp_reset_postdata(); \/\/ \ucffc\ub9ac \ub9ac\uc14b\n<\/code><\/pre>\n<h3>3.2 \ucee4\uc2a4\ud140 \uba54\ud0c0 \ub370\uc774\ud130\ub85c \ud544\ud130\ub9c1\ud558\uae30<\/h3>\n<p>\n    \ucee4\uc2a4\ud140 \uba54\ud0c0 \ub370\uc774\ud130\ub97c \uae30\ubc18\uc73c\ub85c \ud3ec\uc2a4\ud2b8\ub97c \ud544\ud130\ub9c1\ud558\uace0 \ubd88\ub7ec\uc624\ub824\uba74 <code>meta_key<\/code>\uc640 <code>meta_value<\/code>\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>\n$args = array(\n    'post_type' =&gt; 'post',\n    'meta_query' =&gt; array(\n        array(\n            'key' =&gt; 'custom_field', \/\/ \uba54\ud0c0 \ud0a4\n            'value' =&gt; 'This is a custom value', \/\/ \uba54\ud0c0 \uac12\n            'compare' =&gt; '=', \/\/ \ube44\uad50 \uc5f0\uc0b0\uc790\n        ),\n    ),\n);\n\n$query = new WP_Query($args);\n\n\/\/ \ud3ec\uc2a4\ud2b8 \ub8e8\ud504 \uc2dc\uc791\nif ($query-&gt;have_posts()) {\n    while ($query-&gt;have_posts()) {\n        $query-&gt;the_post();\n        the_title('<h2>', '<\/h2>'); \/\/ \ud3ec\uc2a4\ud2b8 \uc81c\ubaa9 \ucd9c\ub825\n        the_content(); \/\/ \ud3ec\uc2a4\ud2b8 \ub0b4\uc6a9 \ucd9c\ub825\n    }\n} else {\n    echo '\uc870\uac74\uc5d0 \ub9de\ub294 \ud3ec\uc2a4\ud2b8\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.';\n}\nwp_reset_postdata(); \/\/ \ucffc\ub9ac \ub9ac\uc14b\n<\/code><\/pre>\n<h2>4. \ub2e4\uc591\ud55c WP_Query \uc635\uc158<\/h2>\n<p>\n    `WP_Query` \ud074\ub798\uc2a4\ub294 \ub2e4\uc591\ud55c \uc778\uc790\ub97c \ud5c8\uc6a9\ud558\uc5ec \ucee4\uc2a4\ud130\ub9c8\uc774\uc9d5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc544\ub798\ub294 \uc720\uc6a9\ud55c \uba87 \uac00\uc9c0 \uc778\uc790\uc785\ub2c8\ub2e4.\n<\/p>\n<ul>\n<li><code>orderby<\/code>: \uc815\ub82c \uae30\uc900. \uc608: &#8216;date&#8217;, &#8216;title&#8217;, &#8216;rand&#8217;<\/li>\n<li><code>order<\/code>: \uc815\ub82c \uc21c\uc11c. &#8216;ASC&#8217; \ub610\ub294 &#8216;DESC&#8217;<\/li>\n<li><code>post_status<\/code>: \ud3ec\uc2a4\ud2b8 \uc0c1\ud0dc. &#8216;publish&#8217;, &#8216;draft&#8217;, &#8216;pending&#8217;<\/li>\n<li><code>tax_query<\/code>: \ud2b9\uc815 \ubd84\ub958\ubc95(Taxonomy)\uc5d0 \ub530\ub77c \ud544\ud130\ub9c1<\/li>\n<\/ul>\n<h3>4.1 \uc815\ub82c \ubc0f \uc0c1\ud0dc \ud544\ud130\ub9c1 \uc608\uc81c<\/h3>\n<pre><code>\n$args = array(\n    'post_type' =&gt; 'post',\n    'orderby' =&gt; 'date', \/\/ \ub0a0\uc9dc \uae30\uc900 \uc815\ub82c\n    'order' =&gt; 'DESC', \/\/ \ub0b4\ub9bc\ucc28\uc21c\n    'post_status' =&gt; 'publish', \/\/ \uac8c\uc2dc\ub41c \ud3ec\uc2a4\ud2b8\ub9cc \ubd88\ub7ec\uc624\uae30\n);\n\n$query = new WP_Query($args);\n\n\/\/ \ub8e8\ud504 \uc2dc\uc791\nif ($query-&gt;have_posts()) {\n    while ($query-&gt;have_posts()) {\n        $query-&gt;the_post();\n        the_title('<h2>', '<\/h2>');\n        the_content();\n    }\n}\nwp_reset_postdata();\n<\/code><\/pre>\n<h3>4.2 Taxonomy\ub97c \uc774\uc6a9\ud55c \ud544\ud130\ub9c1 \uc608\uc81c<\/h3>\n<p>\n    \ud2b9\uc815 \ubd84\ub958\ubc95\uc5d0 \ub530\ub77c \ud3ec\uc2a4\ud2b8\ub97c \ud544\ud130\ub9c1\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.\n<\/p>\n<pre><code>\n$args = array(\n    'post_type' =&gt; 'post',\n    'tax_query' =&gt; array(\n        array(\n            'taxonomy' =&gt; 'category', \/\/ \ubd84\ub958\ubc95\n            'field' =&gt; 'slug', \/\/ \uc2ac\ub7ec\uadf8\ub85c \uac80\uc0c9\n            'terms' =&gt; 'my-category', \/\/ \ubd84\ub958 \uc2ac\ub7ec\uadf8\n        ),\n    ),\n);\n\n$query = new WP_Query($args);\n\n\/\/ \ub8e8\ud504 \uc2dc\uc791\nif ($query-&gt;have_posts()) {\n    while ($query-&gt;have_posts()) {\n        $query-&gt;the_post();\n        the_title('<h2>', '<\/h2>');\n        the_content();\n    }\n}\nwp_reset_postdata();\n<\/code><\/pre>\n<h2>5. \uacb0\ub860<\/h2>\n<p>\n    \uc6cc\ub4dc\ud504\ub808\uc2a4\uc5d0\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130\ub97c \ud6a8\uacfc\uc801\uc73c\ub85c \ucc98\ub9ac\ud558\uace0 \ubd88\ub7ec\uc624\uae30 \uc704\ud574\uc11c\ub294 <code>WP_Query<\/code> \ud074\ub798\uc2a4\ub97c \uc798 \ud65c\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4. \ucee4\uc2a4\ud140 \uba54\ud0c0\ub370\uc774\ud130\uc640 \ub2e4\uc591\ud55c \ucffc\ub9ac \uc635\uc158\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uae30\uc220\uc740 \ud2b9\ud788 \ub370\uc774\ud130\uac00 \ub9ce\uc774 \uc313\uc774\ub294 \ubcf5\uc7a1\ud55c \uc0ac\uc774\ud2b8\uc5d0\uc11c \uc720\uc6a9\ud558\uba70, \uc0ac\uc6a9\uc790 \ub9de\ucda4\ud615 \uc815\ubcf4\ub97c \uc81c\uacf5\ud558\ub294 \ub370 \ud070 \ub3c4\uc6c0\uc744 \uc90d\ub2c8\ub2e4.\n<\/p>\n<p>\n    \uc774\ubc88 \uac15\uc88c\ub97c \ud1b5\ud574 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ucc98\ub9ac\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \uc811\uadfc \ubc29\ubc95\uc5d0 \ub300\ud574 \ub9ce\uc740 \uc815\ubcf4\ub97c \uc5bb\uc73c\uc168\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4. \ub2e4\uc74c \uc2dc\uac04\uc5d0\ub294 \ub354 \uc2ec\ud654\ub41c \uc8fc\uc81c\ub85c \ub3cc\uc544\uc624\uaca0\uc2b5\ub2c8\ub2e4!\n<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc911\uc2ec\uc758 CMS(Content Management System)\uc73c\ub85c, \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud65c\uc6a9\ud558\uc5ec \ud3ec\uc2a4\ud2b8, \uc0ac\uc6a9\uc790, \ub313\uae00, \uc124\uc815 \ub4f1 \ub2e4\uc591\ud55c \ub370\uc774\ud130\ub97c \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \uc6cc\ub4dc\ud504\ub808\uc2a4\uc5d0\uc11c \ucee4\uc2a4\ud140 \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uacfc `WP_Query`\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \ubd88\ub7ec\uc624\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc774\ud574\ud558\uae30 \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \uae30\ubcf8\uc801\uc73c\ub85c MySQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4. \uae30\ubcf8 \ud14c\uc774\ube14 \uad6c\uc870\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4: wp_posts: \ud3ec\uc2a4\ud2b8 \ubc0f \ud398\uc774\uc9c0 \ub370\uc774\ud130 \uc800\uc7a5 wp_users: \uc0ac\uc6a9\uc790 \uc815\ubcf4 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/40186\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[207],"tags":[],"class_list":["post-40186","post","type-post","status-publish","format-standard","hentry","category-207"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/40186\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"\uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc911\uc2ec\uc758 CMS(Content Management System)\uc73c\ub85c, \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud65c\uc6a9\ud558\uc5ec \ud3ec\uc2a4\ud2b8, \uc0ac\uc6a9\uc790, \ub313\uae00, \uc124\uc815 \ub4f1 \ub2e4\uc591\ud55c \ub370\uc774\ud130\ub97c \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \uc6cc\ub4dc\ud504\ub808\uc2a4\uc5d0\uc11c \ucee4\uc2a4\ud140 \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uacfc `WP_Query`\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \ubd88\ub7ec\uc624\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc774\ud574\ud558\uae30 \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \uae30\ubcf8\uc801\uc73c\ub85c MySQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4. \uae30\ubcf8 \ud14c\uc774\ube14 \uad6c\uc870\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4: wp_posts: \ud3ec\uc2a4\ud2b8 \ubc0f \ud398\uc774\uc9c0 \ub370\uc774\ud130 \uc800\uc7a5 wp_users: \uc0ac\uc6a9\uc790 \uc815\ubcf4 &hellip; \ub354 \ubcf4\uae30 &quot;18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/40186\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-03T04:12:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:39:51+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/40186\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/40186\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30\",\"datePublished\":\"2024-11-03T04:12:05+00:00\",\"dateModified\":\"2024-11-26T06:39:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/40186\/\"},\"wordCount\":39,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"\uc6cc\ub4dc\ud504\ub808\uc2a4\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/40186\/\",\"url\":\"https:\/\/atmokpo.com\/w\/40186\/\",\"name\":\"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-03T04:12:05+00:00\",\"dateModified\":\"2024-11-26T06:39:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/40186\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/40186\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/40186\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/40186\/","og_locale":"ko_KR","og_type":"article","og_title":"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"\uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc911\uc2ec\uc758 CMS(Content Management System)\uc73c\ub85c, \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \ud65c\uc6a9\ud558\uc5ec \ud3ec\uc2a4\ud2b8, \uc0ac\uc6a9\uc790, \ub313\uae00, \uc124\uc815 \ub4f1 \ub2e4\uc591\ud55c \ub370\uc774\ud130\ub97c \uad00\ub9ac\ud569\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 \uc6cc\ub4dc\ud504\ub808\uc2a4\uc5d0\uc11c \ucee4\uc2a4\ud140 \ub370\uc774\ud130\ub97c \ucc98\ub9ac\ud558\ub294 \ubc29\ubc95\uacfc `WP_Query`\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc6d0\ud558\ub294 \ub370\uc774\ud130\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \ubd88\ub7ec\uc624\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. 1. \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc774\ud574\ud558\uae30 \uc6cc\ub4dc\ud504\ub808\uc2a4\ub294 \uae30\ubcf8\uc801\uc73c\ub85c MySQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4. \uae30\ubcf8 \ud14c\uc774\ube14 \uad6c\uc870\ub294 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4: wp_posts: \ud3ec\uc2a4\ud2b8 \ubc0f \ud398\uc774\uc9c0 \ub370\uc774\ud130 \uc800\uc7a5 wp_users: \uc0ac\uc6a9\uc790 \uc815\ubcf4 &hellip; \ub354 \ubcf4\uae30 \"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30\"","og_url":"https:\/\/atmokpo.com\/w\/40186\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-03T04:12:05+00:00","article_modified_time":"2024-11-26T06:39:51+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/40186\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/40186\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30","datePublished":"2024-11-03T04:12:05+00:00","dateModified":"2024-11-26T06:39:51+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/40186\/"},"wordCount":39,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["\uc6cc\ub4dc\ud504\ub808\uc2a4"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/40186\/","url":"https:\/\/atmokpo.com\/w\/40186\/","name":"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-03T04:12:05+00:00","dateModified":"2024-11-26T06:39:51+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/40186\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/40186\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/40186\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"18. \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ucc98\ub9ac, WP Query\ub97c \uc0ac\uc6a9\ud55c \ucee4\uc2a4\ud140 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/40186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=40186"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/40186\/revisions"}],"predecessor-version":[{"id":40187,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/40186\/revisions\/40187"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=40186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=40186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=40186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}