{"id":30,"date":"2013-02-06T15:40:43","date_gmt":"2013-02-06T15:40:43","guid":{"rendered":"http:\/\/einaweb.es\/dev\/?p=30"},"modified":"2013-02-06T15:40:43","modified_gmt":"2013-02-06T15:40:43","slug":"cambiar-el-orden-de-los-posts","status":"publish","type":"post","link":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/","title":{"rendered":"Cambiar el orden de los posts"},"content":{"rendered":"<p>Para cambiar el orden de los posts tenemos que incluir en el fichero functions.php de nuesto thema lo siguiente:<\/p>\n<p>\/\/ Function que cambia el orden de los posts<br \/>\nfunction custom_search_orderby($orderby) {<br \/>\nglobal $wpdb;<br \/>\nif\u00a0 ( is_archive() ) {<br \/>\n$orderby = $wpdb-&gt;prefix . \u00abposts.orden ASC, \u00ab.$wpdb-&gt;prefix . \u00abposts.post_title ASC\u00bb;<br \/>\n}<br \/>\nreturn $orderby;<br \/>\n}<br \/>\nadd_filter(&#8216;posts_orderby&#8217;, &#8216;custom_search_orderby&#8217;, 999);<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Para cambiar el orden de los posts tenemos que incluir en el fichero functions.php de nuesto thema lo siguiente: \/\/ Function que cambia el orden de los posts function custom_search_orderby($orderby) { global $wpdb; if\u00a0 ( is_archive() ) { $orderby = $wpdb-&gt;prefix . \u00abposts.orden ASC, \u00ab.$wpdb-&gt;prefix . \u00abposts.post_title ASC\u00bb; } return $orderby; } add_filter(&#8216;posts_orderby&#8217;, &#8216;custom_search_orderby&#8217;, 999);<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-30","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cambiar el orden de los posts - Blog Desarrollador<\/title>\n<meta name=\"description\" content=\"Cambiar el orden de los posts - Blog Desarrollador\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cambiar el orden de los posts - Blog Desarrollador\" \/>\n<meta property=\"og:description\" content=\"Cambiar el orden de los posts - Blog Desarrollador\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Desarrollador\" \/>\n<meta property=\"article:published_time\" content=\"2013-02-06T15:40:43+00:00\" \/>\n<meta name=\"author\" content=\"Angel Fernandez Gutierrez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@afernandezg76\" \/>\n<meta name=\"twitter:site\" content=\"@afernandezg76\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Angel Fernandez Gutierrez\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/\",\"url\":\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/\",\"name\":\"Cambiar el orden de los posts - Blog Desarrollador\",\"isPartOf\":{\"@id\":\"http:\/\/www.einaweb.es\/develop\/#website\"},\"datePublished\":\"2013-02-06T15:40:43+00:00\",\"dateModified\":\"2013-02-06T15:40:43+00:00\",\"author\":{\"@id\":\"http:\/\/www.einaweb.es\/develop\/#\/schema\/person\/2d3361868423160a6db46ce6f9fc9a3c\"},\"description\":\"Cambiar el orden de los posts - Blog Desarrollador\",\"breadcrumb\":{\"@id\":\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"http:\/\/www.einaweb.es\/develop\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cambiar el orden de los posts\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/www.einaweb.es\/develop\/#website\",\"url\":\"http:\/\/www.einaweb.es\/develop\/\",\"name\":\"Blog Desarrollador\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/www.einaweb.es\/develop\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"es\"},{\"@type\":\"Person\",\"@id\":\"http:\/\/www.einaweb.es\/develop\/#\/schema\/person\/2d3361868423160a6db46ce6f9fc9a3c\",\"name\":\"Angel Fernandez Gutierrez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"http:\/\/www.einaweb.es\/develop\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/366f7c75ad085d0dcc2c290559c1aa5947679d86e3a8c55db42ac1c26e16c816?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/366f7c75ad085d0dcc2c290559c1aa5947679d86e3a8c55db42ac1c26e16c816?s=96&d=mm&r=g\",\"caption\":\"Angel Fernandez Gutierrez\"},\"url\":\"http:\/\/www.einaweb.es\/develop\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cambiar el orden de los posts - Blog Desarrollador","description":"Cambiar el orden de los posts - Blog Desarrollador","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":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/","og_locale":"es_ES","og_type":"article","og_title":"Cambiar el orden de los posts - Blog Desarrollador","og_description":"Cambiar el orden de los posts - Blog Desarrollador","og_url":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/","og_site_name":"Blog Desarrollador","article_published_time":"2013-02-06T15:40:43+00:00","author":"Angel Fernandez Gutierrez","twitter_card":"summary_large_image","twitter_creator":"@afernandezg76","twitter_site":"@afernandezg76","twitter_misc":{"Escrito por":"Angel Fernandez Gutierrez"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/","url":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/","name":"Cambiar el orden de los posts - Blog Desarrollador","isPartOf":{"@id":"http:\/\/www.einaweb.es\/develop\/#website"},"datePublished":"2013-02-06T15:40:43+00:00","dateModified":"2013-02-06T15:40:43+00:00","author":{"@id":"http:\/\/www.einaweb.es\/develop\/#\/schema\/person\/2d3361868423160a6db46ce6f9fc9a3c"},"description":"Cambiar el orden de los posts - Blog Desarrollador","breadcrumb":{"@id":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.einaweb.es\/develop\/cambiar-el-orden-de-los-posts\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"http:\/\/www.einaweb.es\/develop\/"},{"@type":"ListItem","position":2,"name":"Cambiar el orden de los posts"}]},{"@type":"WebSite","@id":"http:\/\/www.einaweb.es\/develop\/#website","url":"http:\/\/www.einaweb.es\/develop\/","name":"Blog Desarrollador","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.einaweb.es\/develop\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"es"},{"@type":"Person","@id":"http:\/\/www.einaweb.es\/develop\/#\/schema\/person\/2d3361868423160a6db46ce6f9fc9a3c","name":"Angel Fernandez Gutierrez","image":{"@type":"ImageObject","inLanguage":"es","@id":"http:\/\/www.einaweb.es\/develop\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/366f7c75ad085d0dcc2c290559c1aa5947679d86e3a8c55db42ac1c26e16c816?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/366f7c75ad085d0dcc2c290559c1aa5947679d86e3a8c55db42ac1c26e16c816?s=96&d=mm&r=g","caption":"Angel Fernandez Gutierrez"},"url":"http:\/\/www.einaweb.es\/develop\/author\/admin\/"}]}},"_links":{"self":[{"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/posts\/30","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/comments?post=30"}],"version-history":[{"count":2,"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/posts\/30\/revisions"}],"predecessor-version":[{"id":32,"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/posts\/30\/revisions\/32"}],"wp:attachment":[{"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/media?parent=30"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/categories?post=30"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.einaweb.es\/develop\/wp-json\/wp\/v2\/tags?post=30"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}