{"id":66238,"date":"2017-11-25T19:21:28","date_gmt":"2017-11-25T18:21:28","guid":{"rendered":"https:\/\/pl.wordpress.org\/support\/topic\/wyswietlanie-postow-na-stronie\/"},"modified":"2017-11-25T19:21:28","modified_gmt":"2017-11-25T18:21:28","slug":"wyswietlanie-postow-na-stronie","status":"publish","type":"topic","link":"https:\/\/pl.wordpress.org\/support\/topic\/wyswietlanie-postow-na-stronie\/","title":{"rendered":"Wy\u015bwietlanie post\u00f3w na stronie"},"content":{"rendered":"<p>Witam, od niedawna pr\u00f3buj\u0119 co\u015b dzia\u0142a\u0107 z WordPressem, wiele jeszcze do ko\u0144ca rozumiem i na swojej drodze napotka\u0142em ma\u0142y problem.. Przerabia\u0142em stron\u0119 statyczn\u0105 html na szablon wordpress i wszystko dzia\u0142a, tylko problemem jest wy\u015bwietlanie posta. Chcia\u0142em aby post wy\u015bwietlany by\u0142 na g\u0142\u00f3wnej stronie razem ze wszystkimi wid\u017cetami. Dowiedzia\u0142em si\u0119 \u017ce taki efekt uzyska si\u0119 gdy zamiast single.php, plik nazwiemy singular.php oraz usuniemy page.php. Niestety post mimo tej zmiany wy\u015bwietlany jest na ca\u0142ej stronie, a wid\u017cet, w moim przypadku sidebar, jest wy\u015bwietlany dopiero pod postem.<br \/>\nPoni\u017cej zawarto\u015b\u0107 singular.php<\/p>\n<pre><code>&lt;?php get_header(); ?&gt;\t\n\t\n\t&lt;!-- Main --&gt;\n\t&lt;div id=&quot;main&quot;&gt;\n\t\n\t&lt;?php\n\t\tif ( have_posts() ) :\n\t\t\twhile ( have_posts() ) : the_post();\n\t\t\t\n\t?&gt;\n\n\t\t&lt;!-- Post --&gt;\n\t\t\t&lt;article class=&quot;post&quot;&gt;\n\t\t\t\t&lt;header&gt;\n\t\t\t\t\t&lt;div class=&quot;title&quot;&gt;\n\t\t\t\t\t\t&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt; &lt;\/a&gt;&lt;\/h2&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t\t&lt;div class=&quot;meta&quot;&gt;\n\t\t\t\t\t\t&lt;time class=&quot;published&quot;&gt;&lt;?php the_date(); ?&gt;&lt;\/time&gt;\n\t\t\t\t\t\t&lt;a href=&quot;#&quot; class=&quot;author&quot;&gt;&lt;span class=&quot;name&quot;&gt;&lt;?php the_author(); ?&gt;&lt;\/span&gt;&lt;img src=&quot;images\/avatar.jpg&quot; alt=&quot;&quot; \/&gt;&lt;\/a&gt;\n\t\t\t\t\t&lt;\/div&gt;\n\t\t\t\t&lt;\/header&gt;\n\t\t\t\t&lt;?php\n\t\t\t\t\t\/\/ check if the post has a Post Thumbnail assigned to it.\n\t\t\t\t\tif ( has_post_thumbnail() ) { \n\t\t\t\t?&gt;\n\t\t\t\t&lt;a href=&quot;&lt;?php echo the_permalink(); ?&gt;&quot; class=&quot;image featured&quot;&gt;\n\t\t\t\t&lt;?php the_post_thumbnail(); ?&gt;\n\t\t\t\t&lt;\/a&gt;\n\t\t\t\t&lt;?php } ?&gt;\n\t\t\t\t&lt;p&gt;&lt;?php the_content(); ?&gt;&lt;\/p&gt;\n\t\t\t&lt;\/article&gt;\n\t\t\t\n\t\t&lt;?php \n\t\t\tendwhile;\n\t\tendif;\n\t\t?&gt;\n\t&lt;\/div&gt;\n\n&lt;?php get_sidebar(); ?&gt;\n&lt;?php get_footer(); ?&gt;<\/code><\/pre>\n<p>Czemu tak si\u0119 dzieje?<\/p>\n","protected":false},"template":"","class_list":["post-66238","topic","type-topic","status-publish","hentry","topic-tag-html5","topic-tag-php","topic-tag-single-php","topic-tag-singular-php","topic-tag-szablon","topic-tag-templates","topic-tag-theme","topic-tag-wordpress"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/66238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/66238\/revisions"}],"wp:attachment":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=66238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}