{"id":20227,"date":"2014-02-25T17:40:02","date_gmt":"2014-02-25T17:40:02","guid":{"rendered":"https:\/\/es.wordpress.org\/support\/topic\/ayuda-con-singlephp-1\/"},"modified":"2016-08-06T00:25:15","modified_gmt":"2016-08-06T00:25:15","slug":"ayuda-con-singlephp-1","status":"closed","type":"topic","link":"https:\/\/es.wordpress.org\/support\/topic\/ayuda-con-singlephp-1\/","title":{"rendered":"Ayuda con single.php"},"content":{"rendered":"<p>Hola,<\/p>\n<p>Llevo un par de d\u00edas d\u00e1ndole vueltas a un problema que tengo con el archivo single.php de WordPress. Estoy utilizando una plantilla Premium (Today: http:\/\/themeforest.net\/item\/today-news-magazine-wordpress-theme\/full_screen_preview\/6200502) y necesito modificar la estructura de los elementos de la plantilla single.php. He incluido el plugin SubHeading y quiero cambiar el orden actual: Titulo \/ Autor \/ Subtitulo y poner el subtitulo antes del Autor, pero no consigo hacerlo. Si quito la linea referente al autor, se cambia el orden del sidebar y de coloca debajo del cuerpo, en lugar de a la derecha del cuerpo del post.<\/p>\n<p>Os paso el html:<\/p>\n<pre><code>&lt;?php\nget_header();\n\n$image_id    = get_post_thumbnail_id($post-&gt;ID);\n$cover       = wp_get_attachment_image_src($image_id, &#039;blog-cover&#039;);\n$no_cover    = get_template_directory_uri();\n$cover_full  = get_post_meta($post-&gt;ID, &quot;post_cover&quot;, true) == &#039;yes&#039;;\n$gallery     = get_post_meta($post-&gt;ID, &quot;post_gallery&quot;, true) == &#039;yes&#039;;\n$category    = get_the_category();\n$page_layout = page_sidebar_layout();\n\nif ($cover_full) {\n    echo &#039;\n&lt;div class=&quot;single-cover&quot;&gt;\n\t&lt;div class=&quot;blog-cover-bg&quot;&gt;&lt;\/div&gt;&#039;;\n    if ($image_id) {\n        echo &#039;\n\t&lt;img src=&quot;&#039; . $cover[0] . &#039;&quot; alt=&quot;&#039; . get_the_title() . &#039;&quot; \/&gt;&#039;;\n    } else {\n        echo &#039;\n\t&lt;img src=&quot;&#039; . $no_cover . &#039;\/images\/no-cover\/cover-fullwidth.png&quot; alt=&quot;no-cover&quot; \/&gt;&#039;;\n    }\n    echo &#039;\n\t&lt;h1&gt;&#039;;\n    if (have_posts())\n        while (have_posts()):\n            the_post();\n            echo get_the_title($post-&gt;ID);\n        endwhile;\n    echo &#039;&lt;\/h1&gt;\n\t&lt;span&gt;&#039; . get_the_time(&#039;F jS, Y&#039;) . &#039;&lt;\/span&gt;\n\t&lt;div class=&quot;blog-cover-cat&quot;&gt;&#039; . $category[0]-&gt;cat_name . &#039;&lt;\/div&gt;\n&lt;\/div&gt;&lt;!-- end .single-cover --&gt;\n&#039;;\n}\n\necho &#039;\n&lt;div class=&quot;blog-fixed&quot;&gt;&#039;;\n\nswitch ($page_layout) {\n\n    case &quot;sidebar-left&quot;:\n        echo &#039;\n\t&lt;div id=&quot;blog-right&quot;&gt;&#039;;\n        break;\n\n    case &quot;sidebar-full&quot;:\n        echo &#039;\n\t&lt;div id=&quot;blog-full&quot;&gt;&#039;;\n        break;\n\n    case &quot;sidebar-right&quot;:\n        echo &#039;\n\t&lt;div id=&quot;blog-left&quot;&gt;&#039;;\n        break;\n}\n\nif (have_posts())\n    while (have_posts()):\n        the_post();\n        $image_id = get_post_thumbnail_id($post-&gt;ID);\n        $cover    = wp_get_attachment_image_src($image_id, &#039;blog-one&#039;);\n        $category = get_the_category();\n\t$vimeo    = get_post_meta($post-&gt;ID, &quot;post_vimeo&quot;, true);\n\t$youtube  = get_post_meta($post-&gt;ID, &quot;post_youtube&quot;, true);\n\n        echo &#039;\n\t&lt;div class=&quot;single-archive&quot;&gt;&#039;;\n        if ($cover_full) {\n        } else {\n            echo &#039;\n\t\t\t&lt;h1 class=&quot;single-title&quot;&gt;&lt;a href=&quot;&#039; . get_permalink() . &#039;&quot; rel=&quot;bookmark&quot;&gt;&#039; . get_the_title($post-&gt;ID) . &#039;&lt;\/a&gt;&lt;\/h2&gt;\n                        &lt;div class=&quot;single-info&quot;&gt;&#039;. the_time(&#039;l j \\d\\e\\ F \\d\\e\\ Y \\|\\ G:i  &#039;) . &#039;&lt;a href=&quot;&#039; .get_author_posts_url($author) . &#039;&quot;&gt;&#039;. get_the_author() .  &#039;&lt;\/a&gt; &lt;\/div&gt;&#039; ;\n\nif (function_exists(&#039;the_subheading&#039;)) { the_subheading(&#039;&lt;h5&gt;&#039;, &#039;&lt;\/h5&gt;&#039;);}\n\n            if ($image_id) {\n\t\t\t\tif ($vimeo or $youtube) {\n\t\t\t\t} else {\n                echo &#039;\n\t\t\t&lt;div class=&quot;single-cover-art&quot;&gt;\n\t\t\t\t&lt;img src=&quot;&#039; . $cover[0] . &#039;&quot; alt=&quot;&#039; . get_the_title() . &#039;&quot; \/&gt;&#039;;\n                if ($cat != null) {\n                } else {\n                    echo &#039;\n\t\t\t\t&lt;div class=&quot;slider-left-cat&quot;&gt;&#039; . $category[0]-&gt;cat_name . &#039;&lt;\/div&gt;&#039;;\n                }\n                echo &#039;\n\t\t\t\t&lt;div class=&quot;comment-bubble&quot;&gt;\n\t\t\t\t\t&lt;span class=&quot;comment-count&quot;&gt;&#039; . get_comments_number() . &#039;&lt;\/span&gt;\n\t\t\t\t&lt;\/div&gt;\n\t\t\t&lt;\/div&gt;&#039;;\n\t\t\t\t}\n\t\t\t}\n        }\n\n        require(&#039;admin\/video.php&#039;);\n\n        echo &quot;&lt;p&gt;&quot; . the_content() . &quot;&lt;\/p&gt;&quot;;\n        echo &#039;\n\t\t&lt;\/div&gt;&lt;!-- end .single-archive --&gt;\n&#039;;\n    endwhile;\n\nif ($gallery) {\n    generate_gallery(get_the_ID());\n}\n\necho get_the_tag_list(&#039;&lt;div class=&quot;single-tag&quot;&gt;&#039;,&#039; &#039;,&#039;&lt;\/div&gt;&#039;);\n\ncomments_template(&#039;&#039;, true);\n\necho &#039;\n\t&lt;\/div&gt;&lt;!-- end .blog(left&amp;full&amp;right) --&gt;\n&#039;;\n\nswitch ($page_layout) {\n    case &quot;sidebar-left&quot;:\n        echo &#039;\n&lt;div id=&quot;sidebar-left&quot;&gt;&#039;;\n        wz_setSection(&#039;zone-sidebar&#039;);\n        if (!function_exists(&#039;dynamic_sidebar&#039;) || !dynamic_sidebar(&#039;single-page&#039;));\n        echo &#039;\n&lt;\/div&gt;&lt;!-- end .sidebar-left --&gt;&#039;;\n        break;\n    case &quot;sidebar-full&quot;:\n        break;\n    case &quot;sidebar-right&quot;:\n        echo &#039;\n&lt;div id=&quot;sidebar-right&quot;&gt;&#039;;\n        wz_setSection(&#039;zone-sidebar&#039;);\n        if (!function_exists(&#039;dynamic_sidebar&#039;) || !dynamic_sidebar(&#039;single-page&#039;));\n        echo &#039;\n&lt;\/div&gt;&lt;!-- end .sidebar-right --&gt;&#039;;\n        break;\n}\n\necho &#039;\n&lt;\/div&gt;&lt;!-- end .blog-fixed --&gt;&#039;;\n\nget_footer();\n?&gt;<\/code><\/pre>\n<p>Muchas gracias de antemano.<\/p>\n","protected":false},"template":"","class_list":["post-20227","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/20227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/20227\/revisions"}],"wp:attachment":[{"href":"https:\/\/es.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=20227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}