{"id":27641,"date":"2013-03-31T00:18:08","date_gmt":"2013-03-30T23:18:08","guid":{"rendered":"https:\/\/pl.wordpress.org\/support\/topic\/grafiki-w-poscie-wyswietlane-w-kategori\/"},"modified":"2016-08-05T21:55:28","modified_gmt":"2016-08-05T21:55:28","slug":"grafiki-w-poscie-wyswietlane-w-kategori","status":"closed","type":"topic","link":"https:\/\/pl.wordpress.org\/support\/topic\/grafiki-w-poscie-wyswietlane-w-kategori\/","title":{"rendered":"Grafiki w po\u015bcie wy\u015bwietlane w kategori"},"content":{"rendered":"<p>Witam, chcia\u0142bym aby w kategoriach by\u0142y wy\u015bwietlane grafiki jakie s\u0105 w postach. Grafika ta jest dodana r\u0119cznie z linku z picasa.<\/p>\n<p>Chodzi o to aby te grafiki w kategoriach by\u0142y wy\u015bwietlane w wymiarze 75&#215;75 pix<\/p>\n<p>&#8230;.<\/p>\n<p>Grafiki rozwi\u0105zuje wy\u015bwietlanie chyba ten kod zamieszczony przez Pana Piotra w inym temacie. Ale jak zrobi\u0107 aby by\u0142y one w porz\u0105dnym rozmiarze 75pix<\/p>\n<p>do pliku function wstawiasz:<\/p>\n<pre><code>function catch_post_image()\n{\n\t$first_img = &#039;&#039;;\n\tif ( preg_match( &#039;#(&lt;img [^&gt;]+&gt;)#is&#039;, get_the_content(), $matchess ) ) {\n\t\tif(isset($matchess[1])) {\n\t\t\t$first_img = &#039;&lt;div class=&quot;wp-caption-a alignleft&quot;&gt;&lt;a href=&quot;&#039;.get_permalink().&#039;&quot;&gt;&#039;.$matchess[1].&#039;&lt;\/a&gt;&lt;\/div&gt;&#039;;\n\t\t}\n\t}\n\treturn $first_img;\n}<\/code><\/pre>\n<p>A w pliku np home lub category wstawiasz nast\u0119puj\u0105cy kod:<\/p>\n<pre><code>&lt;div class=&quot;post-entry&quot;&gt;\n                    &lt;?php if ( has_post_thumbnail()) : ?&gt;\n                        &lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot; title=&quot;&lt;?php the_title_attribute(); ?&gt;&quot; &gt;\n\t\t\t\t\t\t\t&lt;?php the_post_thumbnail(&#039;homepage-thumb&#039;); ?&gt;\n                        &lt;\/a&gt;\n                    &lt;?php else: ?&gt;\n\t\t\t\t\t\t&lt;?=catch_post_image()?&gt;\n\t\t\t\t\t&lt;?php endif; ?&gt;\n                    &lt;?php the_excerpt(); ?&gt;\n                    &lt;?php wp_link_pages(array(&#039;before&#039; =&gt; &#039;&lt;div class=&quot;pagination&quot;&gt;&#039; . __(&#039;Pages:&#039;, &#039;responsive-child-theme&#039;), &#039;after&#039; =&gt; &#039;&lt;\/div&gt;&#039;)); ?&gt;\n                &lt;\/div&gt;&lt;!-- end of .post-entry --&gt;<\/code><\/pre>\n<p>Czy kto\u015b jest w stanie mi pom\u00f3c?<\/p>\n","protected":false},"template":"","class_list":["post-27641","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/topic\/27641","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\/27641\/revisions"}],"wp:attachment":[{"href":"https:\/\/pl.wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=27641"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}