Strict Standards: Redefining already defined constructor for class bbdb in /home/themes/public_html/forums/bb-includes/db-mysql.php on line 12

Strict Standards: Declaration of BB_Walker_Blank::start_lvl() should be compatible with BB_Walker::start_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_lvl() should be compatible with BB_Walker::end_lvl($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::start_el() should be compatible with BB_Walker::start_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Strict Standards: Declaration of BB_Walker_Blank::end_el() should be compatible with BB_Walker::end_el($output) in /home/themes/public_html/forums/bb-includes/classes.php on line 1127

Warning: Cannot modify header information - headers already sent by (output started at /home/themes/public_html/forums/bb-includes/db-mysql.php:12) in /home/themes/public_html/forums/my-templates/kakumei-variant/rss2.php on line 1
ThemeShaper Forums Tag: thumbnail http://forums.themeshaper.com/ Help In Shaping WordPress Themes en Wed, 27 May 2015 01:42:41 +0000 Mihovil on "Which file should I edit to add my own class to class="attachment-thumbnail" ?" http://forums.themeshaper.com/topic/which-file-should-i-edit-to-add-my-own-class-to-classattachment-thumbnail#post-27374 Mon, 11 Jun 2012 15:35:29 +0000 Mihovil 27374@http://forums.themeshaper.com/ <p>Switched to the new forum -&gt; <a href="http://thematictheme.com/forums/topic/which-file-should-i-edit-to-add-my-own-class-to-classattachment-thumbnail/" rel="nofollow">http://thematictheme.com/forums/topic/which-file-should-i-edit-to-add-my-own-class-to-classattachment-thumbnail/</a> :) </p> Mihovil on "Which file should I edit to add my own class to class="attachment-thumbnail" ?" http://forums.themeshaper.com/topic/which-file-should-i-edit-to-add-my-own-class-to-classattachment-thumbnail#post-27372 Mon, 11 Jun 2012 14:59:56 +0000 Mihovil 27372@http://forums.themeshaper.com/ <p>Hi everyone,</p> <p>Can someone please tell me which page of TTF should I edit to add my own class to "attachment-thumbnail" class? Basically what I need to do is add new class so I will get this: class="attachment-thumbnail lightbox" - this way my attached images will open in a pop up and not just in the parent window as they do by default.</p> <p>Thanks! </p> kim4true on "magazine style homepage" http://forums.themeshaper.com/topic/magazine-style-homepage#post-23634 Fri, 28 Oct 2011 01:35:21 +0000 kim4true 23634@http://forums.themeshaper.com/ <p>O.K., I haven't got the homepage working yet, but the rest of the posts benefited from this post about excerpts: <a href="http://forums.themeshaper.com/topic/how-to-make-excerpts-roll-over-and-say-uncle?replies=11#post-23633" rel="nofollow">http://forums.themeshaper.com/topic/how-to-make-excerpts-roll-over-and-say-uncle?replies=11#post-23633</a> </p> kim4true on "magazine style homepage" http://forums.themeshaper.com/topic/magazine-style-homepage#post-23617 Wed, 26 Oct 2011 19:30:24 +0000 kim4true 23617@http://forums.themeshaper.com/ <p>I followed instructions in a book, "Build Your Own Wicked WordPress Themes", and successfully got my homepage rearranged so that it displays a limited number of posts across a full-width page, with a thumbnail for the first post.</p> <p>See it at: <a href="http://debraclopton.com/w/" rel="nofollow">http://debraclopton.com/w/</a></p> <p>I am a novice with php, and the book left me hanging on a few points. Here are the things I am having difficulty with. Any and all help would be appreciated:</p> <p>1. I want the post for the first thumbnail to display the whole book-cover, but it is getting cropped. </p> <p>2. I'd like to be able to post a custom excerpt for the homepage so that the styling is better, and more text is included, but can't work out where/how to filter that.</p> <p>3. I'd like to display only one category on the homepage, but again, I'm stumped!</p> <p>==============================================</p> <p>Here's the code on my child-theme's function.php:</p> <p>&lt;?php</p> <p>// Add support for thumbnails<br /> add_theme_support('post-thumbnails');<br /> set_post_thumbnail_size(300, 482, false);<br /> add_image_size('homepage-thumbnail',300, 482, false);</p> <p>// output a list of top-level pages<br /> function authorsite_footer_pagelinks() {<br /> echo '&lt;ul id="simplepages"&gt;';<br /> wp_list_pages('depth=1&#38;sort_column=menu_order&#38;title_li=');<br /> echo '';<br /> }</p> <p>// Add Header Image<br /> function thematic_logo_image() {<br /> echo '<a href="'.get_bloginfo('url').'" title="'.get_bloginfo('name').'">&lt;span id="header-image"&gt;&lt;/span&gt;</a>';<br /> }<br /> add_action('thematic_header','thematic_logo_image',6);</p> <p>// custom homepage loop<br /> function authorsite_indexloop() {<br /> query_posts("posts_per_page=4");<br /> $counter = 1;<br /> if (have_posts()) : while (have_posts()) : the_post(); ?&gt;<br /> &lt;div id="post-&lt;?php the_ID() ?&gt;" class="&lt;?php thematic_post_class() ?&gt;"&gt;<br /> &lt;?php thematic_postheader();<br /> if ($counter == 1 &#38;&#38; has_post_thumbnail() &#38;&#38; !is_paged()) {<br /> the_post_thumbnail('homepage-thumbnail');<br /> } ?&gt;<br /> &lt;div class="entry-content"&gt;<br /> &lt;?php the_excerpt(); ?&gt;<br /> <a>" class="more"&gt;&lt;?php echo more_text() ?&gt;</a><br /> &lt;?php $counter++; ?&gt;<br /> &lt;/div&gt;<br /> &lt;/div&gt;&lt;!-- .post --&gt;<br /> &lt;?php endwhile; else: ?&gt;<br /> &lt;h2&gt;Oops!&lt;/h2&gt;<br /> &lt;p&gt;Something is not working quite right here. Please contact us and let us know using the contact link you'll find in the top menu. Thank you!&lt;/p&gt;<br /> &lt;?php endif;<br /> wp_reset_query();<br /> }</p> <p>?&gt;</p> <p>==============================================</p> <p>and here's the home.php:</p> <p>&lt;?php</p> <p> // calling the header.php<br /> get_header();</p> <p> // action hook for placing content above #container<br /> thematic_abovecontainer();</p> <p>?&gt;</p> <p> &lt;div id="container"&gt;</p> <p> &lt;?php thematic_abovecontent(); ?&gt;</p> <p> &lt;div id="content"&gt;</p> <p> &lt;?php </p> <p> // create the navigation above the content<br /> thematic_navigation_above();</p> <p> // calling the widget area 'index-top'<br /> get_sidebar('index-top');</p> <p> // action hook for placing content above the index loop<br /> thematic_above_indexloop();</p> <p> // action hook creating the index loop<br /> //thematic_indexloop();</p> <p> // a custom homepage loop<br /> authorsite_indexloop();</p> <p> // action hook for placing content below the index loop<br /> thematic_below_indexloop();</p> <p> // calling the widget area 'index-bottom'<br /> get_sidebar('index-bottom');</p> <p> // create the navigation below the content<br /> // thematic_navigation_below();</p> <p> ?&gt;</p> <p> &lt;/div&gt;&lt;!-- #content --&gt;</p> <p> &lt;?php thematic_belowcontent(); ?&gt; </p> <p> &lt;/div&gt;&lt;!-- #container --&gt;</p> <p>&lt;?php </p> <p> // action hook for placing content below #container<br /> thematic_belowcontainer();</p> <p> // calling the standard sidebar<br /> // thematic_sidebar();</p> <p> // calling footer.php<br /> get_footer('homepage');<br /> ?&gt;</p> <p>==============================================</p> <p>and this is the homepage specific css from the stylesheet:</p> <p>/* =Homepage specific styles<br /> -------------------------------------------------------------- */<br /> body.home #container {<br /> float: none;<br /> margin: 0;<br /> width:960px;<br /> }<br /> body.home #content {<br /> width:900px;<br /> overflow:hidden;<br /> margin: 0 0 0 10px;<br /> }</p> <p>body.home .hentry {<br /> width: inherit;<br /> }</p> <p>body.home ul#simplepages {<br /> width: 940px;<br /> margin: 0 auto;<br /> }</p> <p>body.home ul#simplepages li {<br /> list-style-type: none;<br /> display: inline;<br /> margin-right: 30px;<br /> }</p> <p>body.home div.p1 {<br /> font-size: 120%;<br /> height: 325px;<br /> }</p> <p>body.home div.p1 img {<br /> float: left;<br /> margin-right: 30px;<br /> }</p> <p>body.home div.p2 {<br /> clear: left;<br /> }</p> <p>body.home div.p2,<br /> body.home div.p3,<br /> body.home div.p4 {<br /> width: 270px;<br /> float: left;<br /> margin-top: 22px;<br /> }</p> <p>body.home div.p3 {<br /> margin-left: 30px;<br /> margin-right: 30px;<br /> } </p> ki11ua2 on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22508 Tue, 02 Aug 2011 13:07:21 +0000 ki11ua2 22508@http://forums.themeshaper.com/ <p>You're right!<br /> Thank you </p> helgatheviking on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22455 Thu, 28 Jul 2011 13:47:00 +0000 helgatheviking 22455@http://forums.themeshaper.com/ <p>that doesn't mess up your full page posts? b/c you aren't returning any value for them, nor returning the unaltered version. thematic already enables post_thumbnails so you don't need that i don't think. trimmed down.</p> <pre><code>function list_thickbox_thumbs($post){ global $thematic_content_length; if ( strtolower($thematic_content_length) == &#39;excerpt&#39;) { $post = &#39;&#39;; if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id(), &#39;full&#39; ); $post = &#39;&lt;a class=&quot;entry-thumb&quot; class=&quot;thickbox&quot; href=&quot;&#39; . $image[0] . &#39;&quot; title=&quot; &#39; . get_the_title() . &#39;&quot; &gt;&#39; . get_the_post_thumbnail(get_the_ID(), &#39;thumbnail&#39;, array(&#39;title&#39; =&gt; &#39; &#39; . $post_title)) . &#39;&lt;/a&gt;&#39; . $post; } } return $post; } add_filter(&#39;thematic_post&#39;, &#39;list_thickbox_thumbs&#39;);</code></pre> ki11ua2 on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22452 Thu, 28 Jul 2011 09:27:44 +0000 ki11ua2 22452@http://forums.themeshaper.com/ <p>This worked:<br /> <pre><code>//To enable post thumbnails add_theme_support( &#39;post-thumbnails&#39; ); function list_thickbox_thumbs($post){ global $thematic_content_length; if ( strtolower($thematic_content_length) == &#39;excerpt&#39;) { $post = &#39;&#39;; $post .= get_the_excerpt(); $post = apply_filters(&#39;the_excerpt&#39;,$post); if ( apply_filters( &#39;thematic_post_thumbs&#39;, TRUE) ) { $post_title = get_the_title(); $size = apply_filters( &#39;thematic_post_thumb_size&#39; , array(120,120) ); $attr = apply_filters( &#39;thematic_post_thumb_attr&#39;, array(&#39;title&#39; =&gt; &#39; &#39; . $post_title) ); if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id(), &#39;full&#39; ); $post = &#39;&lt;a class=&quot;entry-thumb&quot; class=&quot;thickbox&quot; href=&quot;&#39; . $image[0] . &#39;&quot; title=&quot; &#39; . get_the_title() . &#39;&quot; &gt;&#39; . get_the_post_thumbnail(get_the_ID(), $size, $attr) . &#39;&lt;/a&gt;&#39; . $post; } } return $post; } $post = &#39;&#39; . get_the_post_thumbnail(get_the_ID(), $size, $attr) . &#39;&#39;; } add_filter(&#39;thematic_post&#39;, &#39;list_thickbox_thumbs&#39;);</code></pre> <p>Thank you </p> helgatheviking on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22430 Tue, 26 Jul 2011 13:56:47 +0000 helgatheviking 22430@http://forums.themeshaper.com/ <p>you shouldn't need to override the whole thing if you are only changing part. that's the point of filters. did mine not work? i might have forgotten to<br /> global $thematic_content_length; </p> ki11ua2 on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22429 Tue, 26 Jul 2011 07:48:46 +0000 ki11ua2 22429@http://forums.themeshaper.com/ <p>Thanks for the reply,</p> <p>The solution was to add the following in my custom function file:</p> <pre><code>function childtheme_override_content() { global $thematic_content_length; if ( strtolower($thematic_content_length) == &#39;full&#39; ) { $post = get_the_content(more_text()); $post = apply_filters(&#39;the_content&#39;, $post); $post = str_replace(&#39;]]&gt;&#39;, &#39;]]&gt;&#39;, $post); } elseif ( strtolower($thematic_content_length) == &#39;excerpt&#39;) { $post = &#39;&#39;; $post .= get_the_excerpt(); $post = apply_filters(&#39;the_excerpt&#39;,$post); if ( apply_filters( &#39;thematic_post_thumbs&#39;, TRUE) ) { $post_title = get_the_title(); $size = apply_filters( &#39;thematic_post_thumb_size&#39; , array(100,100) ); $attr = apply_filters( &#39;thematic_post_thumb_attr&#39;, array(&#39;title&#39; =&gt; &#39;Image of &#39; . $post_title) ); if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id(), &#39;full&#39; ); $post = &#39;&lt;a class=&quot;entry-thumb&quot; class=&quot;thickbox&quot; href=&quot;&#39; . $image[0] . &#39;&quot; title=&quot;Image of &#39; . get_the_title() . &#39;&quot; &gt;&#39; . get_the_post_thumbnail(get_the_ID(), $size, $attr) . &#39;&lt;/a&gt;&#39; . $post; } } } elseif ( strtolower($thematic_content_length) == &#39;none&#39;) { } else { $post = get_the_content(more_text()); $post = apply_filters(&#39;the_content&#39;, $post); $post = str_replace(&#39;]]&gt;&#39;, &#39;]]&gt;&#39;, $post); } echo apply_filters(&#39;thematic_post&#39;, $post); } // end content</code></pre> <p>The solution was inspired by the current post &#38; this: <a href="http://forums.themeshaper.com/topic/changing-content-of-excerpt-conditionally-and-editing-all-loops-at-once" rel="nofollow">http://forums.themeshaper.com/topic/changing-content-of-excerpt-conditionally-and-editing-all-loops-at-once</a></p> <p>Your post again</p> <p>So double thanks </p> helgatheviking on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22421 Mon, 25 Jul 2011 14:06:55 +0000 helgatheviking 22421@http://forums.themeshaper.com/ <p>i think you're attacking the wrong filter... if you look at the function thematic_content() in header-extensions.php you'll see </p> <p>echo apply_filters('thematic_post', $post);</p> <p>so the filter to target is actually called thematic_post. idk why they did it that way. i banged my head into the wall over it for a long time. but the important thing to take away from it is that the filter name does not always match the function name. the filter name is the first parameter in the apply_filters statement. </p> <p>oh and you will need to RETURN something. otherwise you don't actually pass info to the filter.</p> <p>then you should be able to do something like</p> <pre><code>function kia_lightbox_thumbs($post){ if ( strtolower($thematic_content_length) == &#39;excerpt&#39;) { $post = &#39;&#39;; if ( apply_filters( &#39;thematic_post_thumbs&#39;, TRUE) ) { $post_title = get_the_title(); $size = apply_filters( &#39;thematic_post_thumb_size&#39; , array(100,100) ); $attr = apply_filters( &#39;thematic_post_thumb_attr&#39;, array(&#39;title&#39; =&gt; &#39;Permalink to &#39; . $post_title) ); if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id(), &#39;full&#39; ); $post = &#39;&lt;a class=&quot;entry-thumb&quot; class=&quot;lightbox&quot; href=&quot;&#39; . $image[0] . &#39;&quot; title=&quot;Permalink to &#39; . get_the_title() . &#39;&quot; &gt;&#39; . get_the_post_thumbnail(get_the_ID(), $size, $attr) . &#39;&lt;/a&gt;&#39; . $post; } } } return $post; } $post = &#39;&#39; . get_the_post_thumbnail(get_the_ID(), $size, $attr) . &#39;&#39;; } add_filter(&#39;thematic_content&#39;, &#39;kia_lightbox_thumbs&#39;);</code></pre> <p>you almost surely have to add some kind of class="lightbox" (depending on what plugin you're using) to the link. and the link src needs to point to the full size image, which is what i am doing with wp_get_attachment_image_src() function.</p> <p>untested, so there could be typos. note, you didn't put the excerpt in yours so i left it out. this will only show the thumbnail with no fallback if there isn't a thumbnail. </p> ki11ua2 on "thematic_content change thumbnail link" http://forums.themeshaper.com/topic/thematic_content-change-thumbnail-link#post-22420 Mon, 25 Jul 2011 12:39:43 +0000 ki11ua2 22420@http://forums.themeshaper.com/ <p>I'm trying to change the link of the thumbnail for the default thematic_content latest posts loop.<br /> What I want is the thumb to open in lightbox at the original size.<br /> I'm trying with variations of the following code, but does'n seem to ovverride it.</p> <p>function custom_content($content) {<br /> if ( strtolower($thematic_content_length) == 'excerpt') {<br /> if ( apply_filters( 'thematic_post_thumbs', TRUE) ) {<br /> if ( has_post_thumbnail() ) {<br /> $post = '<a href="' . get_the_post_thumbnail(get_the_ID(), $size, $attr) . '" title="Permalink to ' . get_the_title() . '">' . get_the_post_thumbnail(get_the_ID(), $size, $attr) . '</a>' . $post;<br /> }<br /> }<br /> }<br /> }<br /> add_filter('thematic_content', 'custom_content');</p> <p>Any ideas?</p> <p>Thank you </p> Laraine on "Separate thumbnail and full image files in WP native gallery" http://forums.themeshaper.com/topic/separate-thumbnail-and-full-image-files-in-wp-native-gallery#post-22268 Tue, 12 Jul 2011 01:29:51 +0000 Laraine 22268@http://forums.themeshaper.com/ <p>This thread comes closest to my question. Next/previous navigation on WP's own Gallery pages is missing from my image gallery attachments. Thanks for advice on solving this.</p> <p><a href="http://www.larainearmenti.com/portfolio/01_scone/" rel="nofollow">http://www.larainearmenti.com/portfolio/01_scone/</a> </p> jhkoning on "Get-The-Image for Category & Tag Archives" http://forums.themeshaper.com/topic/get-the-image-for-category-038-tag-archives#post-22260 Sun, 10 Jul 2011 08:20:58 +0000 jhkoning 22260@http://forums.themeshaper.com/ <p>Thanks @ridgely - this helped me out too - much appreciated,<br /> Jas </p> mgwaters on "creating a thumbnail gallery in a category archive" http://forums.themeshaper.com/topic/creating-a-thumbnail-gallery-in-a-category-archive#post-21982 Wed, 22 Jun 2011 00:13:24 +0000 mgwaters 21982@http://forums.themeshaper.com/ <p>Hello, I am trying to do a similar effect for one category, and have a grid style (3 images/tn wide) by 2~4 rows (haven't decided yet on how many rows) So you identified the category by including this correct &gt;&gt; if (is_category('drawing'))</p> <p>I re-defined by medium sized thumbnails to be resized to 250px wide in the admin &gt; setttings &gt; media section so I should just be able to grab those correct? So I wouldn't need your first function? Also, I'd love to include the post title and excerpt. Did you just eliminate those using css styles?</p> <p>Did you have to create a custom template? </p> <p>Any assistance is appreciated! </p> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21762 Thu, 09 Jun 2011 03:44:25 +0000 helgatheviking 21762@http://forums.themeshaper.com/ <p>you're welcome. i'm glad you got it sorted. </p> vicky515 on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21749 Wed, 08 Jun 2011 23:50:49 +0000 vicky515 21749@http://forums.themeshaper.com/ <p>Hi Middle and Helga! Sorry about my brutal delay in responding - I was busy preparing for a conference.</p> <p>Thanks so much for that explanation, Middle, that makes perfect sense. I will definately be keeping this topic handy for future reference :)</p> <p>As for the thumbnail,<br /> <code>the_post_thumbnail(&#39;thumbnail&#39;)</code><br /> worked exactly! I think I'm more comfortable using this approach, just because it's consistent with the rest of the code and easier to understand.</p> <p>Thank you so much Helga, again, for your amazing help.<br /> And middlesister, your explanations were extremely helpful! &lt;3 </p> middlesister on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21552 Mon, 30 May 2011 16:37:19 +0000 middlesister 21552@http://forums.themeshaper.com/ <p>The filters attached to 'the_excerpt' are wptexturize, convert_smilies, convert_chars, wpautop and shortcode_unautop. None of these generate any excerpt. 'wp_trim_excerpt' is attached to 'get_the_excerpt', so probably apply_filters('get_the_excerpt', $content) would work. </p> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21550 Mon, 30 May 2011 15:22:44 +0000 helgatheviking 21550@http://forums.themeshaper.com/ <p>that is weird about the thumbnail, b/c the small 'thumbnail' size is supposed to be the default if you don't pass any parameters. try</p> <p>the_post_thumbnail('thumbnail')</p> <p>and setup_postdata is what has allowed me to scrap the $content method that i was using before b/c it gives me access to all the functions that pull from the post's data. also :</p> <p>the_post_thumbnail() probably performs </p> <p>echo get_the_post_thumbnail($page-&gt;ID, 'thumbnail'); </p> <p>in the backend. so they really aren't different. they're connected. the_post_thumbnail just echos out by default whereas get_the_post_thumbnail returns a variable. like the_excerpt() is just echo get_the_excerpt(). same deal. </p> <p>also good point to middle sister that page's don't have excerpts by default and you should add them via her code. but the_excerpt() will look preferentially for a custom excerpt and failing that trim the content to the appropriate length.</p> <p>i wish i could tell you why apply_filters('the_excerpt', $content) didn't work, but i honestly don't know. </p> middlesister on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21547 Mon, 30 May 2011 09:16:27 +0000 middlesister 21547@http://forums.themeshaper.com/ <p>I think the reason that the array didn't work is that <code>post_excerpt</code> is the place for the manually written excerpt, and pages doesn't have them by default. Trying to call it from the array would just turn up an empty string. You can add the functionality if you like with<br /> <pre><code>function my_add_excerpts_to_pages() { add_post_type_support( &#39;page&#39;, &#39;excerpt&#39; ); } add_action( &#39;init&#39;, &#39;my_add_excerpts_to_pages&#39; );</code></pre> <p>Calling "<code>the_exerpt()</code>" in the loop will check for <code>post_excerpt</code> and when that is empty, generate an excerpt for you. The filters attached to <code>the_excerpt</code> are not the ones doing that. I don't think your grasp of filters is wrong, you were just not applying the one you needed. If you want to use filters I think "<code>get_the_excerpt</code>" would be the one, or call "<code>wp_trim_excerpt($content)</code>" directly. All in all, the "<code>setup_postdata()</code>" method is probably the best way to go, because then you would be guaranteed that your excerpt gets the same treatment and applied filters as all other excerpts. But since you asked... :-) </p> vicky515 on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21543 Mon, 30 May 2011 01:39:20 +0000 vicky515 21543@http://forums.themeshaper.com/ <p>Oh sorry, I probably should have said that I tried it first and nothing printed. That's when I tried print_r as per your suggestion and noticed it was blank in the array.</p> <p>OMG YOU'RE AWESOME!<br /> That works perfectly - except the thumbnail, it came out full-size on the page. I replaced it with what I had before which worked great. Is there a reason I should use "the_post_thumbnail" instead?<br /> <pre><code>&lt;?php echo get_the_post_thumbnail($page-&gt;ID, &#39;thumbnail&#39;); ?&gt;</code></pre> <p>Oh boy am I confused though, lol... I'm sorry if these are really basic questions. I had a good understanding when we used the array, but completely scrapping that has me a bit lost. I'm going through the codex so it might click soon...<br /> You have switched from a "get_" approach to a more direct call. So you're putting only the content of the post in the $content variable, but why does "echo the_excerpt();" work in this case? why couldn't we do this with the array?</p> <p>And this goes back, why did "apply_filters('the_excerpt', $content)" not work? I was thinking that made a lot of sense because the filter "the_excerpt" would truncate the results or something but that ended up not being the case. This question is more related to my incomplete grasp of how filters work.</p> <p>Thank you &lt;3 </p> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21542 Sun, 29 May 2011 21:02:49 +0000 helgatheviking 21542@http://forums.themeshaper.com/ <p>what about:</p> <pre><code>function child_pages(){ global $post; $mypages = get_pages(&#39;child_of=&#39;.$post-&gt;ID.&#39;&#38;sort_column=post_date&#38;sort_order=desc&#39;); foreach($mypages as $post) : setup_postdata($post); $content = $post-&gt;post_content; if(!$content) // Check for empty page continue; the_post_thumbnail(); ?&gt; &lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink(); ?&gt;&quot;&gt;&lt;?php echo the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;div class=&quot;entry&quot;&gt;&lt;?php echo the_excerpt(); ?&gt;&lt;/div&gt; &lt;?php endforeach; } add_action(&#39;thematic_belowpost&#39;,&#39;child_pages&#39;);</code></pre> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21541 Sun, 29 May 2011 19:44:45 +0000 helgatheviking 21541@http://forums.themeshaper.com/ <p>try post_excerpt anyway.... if it doesn't have an explicitly set value it might pull the content trimmed to the right length? </p> <p>i wonder if you could do something similar to get_posts, use setup_postdata() <a href="http://codex.wordpress.org/Template_Tags/get_posts" rel="nofollow">http://codex.wordpress.org/Template_Tags/get_posts</a></p> <p>then you might be able to call the_excerpt()</p> <p>? </p> vicky515 on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21540 Sun, 29 May 2011 19:14:11 +0000 vicky515 21540@http://forums.themeshaper.com/ <p>Oh! That's handy! :D And now I understand it a bit better.<br /> So it looks like it <em>would</em>, except that the post_excerpt key in the array is blank.</p> <pre><code>[post_title] =&gt; This is a test page [post_excerpt] =&gt; [post_status] =&gt; publish</code></pre> <p>Strange! And unfortunately I didn't see any other keys that contained the appropriate data other than post_content.</p> <p>For reference, here are all the keys:</p> <ul> <li>[ID]</li> <li>[post_author]</li> <li>[post_date]</li> <li>[post_date_gmt]</li> <li>[post_content]</li> <li>[post_title]</li> <li>[post_excerpt]</li> <li>[post_status]</li> <li>[comment_status]</li> <li>[ping_status]</li> <li>[post_password]</li> <li>[post_name]</li> <li>[to_ping]</li> <li>[pinged]</li> <li>[post_modified]</li> <li>[post_modified_gmt]</li> <li>[post_content_filtered]</li> <li>[post_parent]</li> <li>[guid]</li> <li>[menu_order]</li> <li>[post_type]</li> <li>[post_mime_type]</li> <li>[comment_count]</li> <li>[filter]</li> </ul> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21539 Sun, 29 May 2011 18:03:37 +0000 helgatheviking 21539@http://forums.themeshaper.com/ <p>i think this is wrong:</p> <p>$content = apply_filters('the_excerpt',$content);</p> <p>i <em>think</em> that this (which will always get the full post to the "more" tag:<br /> $content = $page-&gt;post_content;</p> <p>needs to be different. maybe</p> <p>$content = $page-&gt;post_excerpt; </p> <p>but i'm not 100% sure what is in the post object- w/o booting up my local install and running a print_r($page) just to see. </p> vicky515 on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21537 Sun, 29 May 2011 15:04:45 +0000 vicky515 21537@http://forums.themeshaper.com/ <p>Aha! Figured out the thumbnail...</p> <pre><code>&lt;?php echo get_the_post_thumbnail($page-&gt;ID, &#39;thumbnail&#39;); ?&gt;&lt;h2&gt;&lt;a href=&quot;&lt;?php echo get_page_link($page-&gt;ID) ?&gt;&quot;&gt;&lt;?php echo $page-&gt;post_title ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;div class=&quot;entry&quot;&gt;&lt;?php echo $content ?&gt;&lt;/div&gt;</code></pre> <p><em>Originally I posted a question asking how to stylize it but there's a super handy explanation in the codex so nevermind!<br /> <a href="http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail#Styling_Post_Thumbnails" rel="nofollow">http://codex.wordpress.org/Function_Reference/get_the_post_thumbnail#Styling_Post_Thumbnails</a></em></p> <p>So now it really is just the excerpt that I'm stuck on. </p> vicky515 on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21535 Sun, 29 May 2011 14:58:17 +0000 vicky515 21535@http://forums.themeshaper.com/ <p>Alright, rock and roll... While trying to figure this out I think I got a bit closer to better understanding filters. Although it doesn't work, so maybe not!</p> <p>So here is my modified version for attempting to accomplish this (thanks Helga!).<br /> <pre><code>function child_pages(){ global $post; $mypages = get_pages(&#39;child_of=&#39;.$post-&gt;ID.&#39;&#38;sort_column=post_date&#38;sort_order=desc&#39;); foreach($mypages as $page) { $content = $page-&gt;post_content; if(!$content) // Check for empty page continue; $content = apply_filters(&#39;the_excerpt&#39;,$content); ?&gt; &lt;?php the_post_thumbnail(); ?&gt;&lt;h2&gt;&lt;a href=&quot;&lt;?php echo get_page_link($page-&gt;ID) ?&gt;&quot;&gt;&lt;?php echo $page-&gt;post_title ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;div class=&quot;entry&quot;&gt;&lt;?php echo $content ?&gt;&lt;/div&gt; &lt;?php } } add_action(&#39;thematic_belowpost&#39;,&#39;child_pages&#39;);</code></pre> <p>I made a lot of revisions but what I have shown here is what makes the most sense to me. But neither of the two lines that I changed work lol... So rather than post all the possible variations I tried, I'm just going to ask for help with this one.</p> <p>First one, attempting to apply the_excerpt filter to $content - it is still showing the post in it's entirety. According to what I'm reading in the Codex, this <em>should</em> work. The only reason it may not be working, I'm thinking, is if my pages don't contain the required &lt;!--more--&gt; tag. Could that be the case? Or is my logic incorrect?</p> <p>Second one, adding the_post_thumbnail before the title (from the article soneal posted). Reading the codex my only thought was that maybe my theme didn't support it?<br /> <a href="http://codex.wordpress.org/Post_Thumbnails" rel="nofollow">http://codex.wordpress.org/Post_Thumbnails</a></p> <p>But then I found this in Thematic's functions.php so it must be ok, right?<br /> <pre><code>// Check for WordPress 2.9 add_theme_support() if ( apply_filters( &#39;thematic_post_thumbs&#39;, TRUE) ) { if ( function_exists( &#39;add_theme_support&#39; ) ) add_theme_support( &#39;post-thumbnails&#39; ); }</code></pre> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21532 Sun, 29 May 2011 04:53:06 +0000 helgatheviking 21532@http://forums.themeshaper.com/ <p>hey no problem, though it does help sometimes to see what you've tried and to know what is failing and how it is failing. i don't see it too often here, but i just like to make sure that i am helping someone learn and not doing the work for them. </p> <p>but the link i posted should get you started. take what they have and hook it in somewhere with a function</p> <pre><code>function child_pages(){ global $post; $mypages = get_pages(&#39;child_of=&#39;.$post-&gt;ID.&#39;&#38;sort_column=post_date&#38;sort_order=desc&#39;); foreach($mypages as $page) { $content = $page-&gt;post_content; if(!$content) // Check for empty page continue; $content = apply_filters(&#39;the_content&#39;, $content); ?&gt; &lt;h2&gt;&lt;a href=&quot;&lt;?php echo get_page_link($page-&gt;ID) ?&gt;&quot;&gt;&lt;?php echo $page-&gt;post_title ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;div class=&quot;entry&quot;&gt;&lt;?php echo $content ?&gt;&lt;/div&gt; &lt;?php } } add_action(&#39;thematic_abovemainasides&#39;,&#39;child_pages&#39;);</code></pre> <p>i didn't test this, now it <em>should</em> be just a matter of adjusting the $content from:<br /> $content = $page-&gt;post_content; </p> <p>to whatever you'd like. and adding whatever markup you want too. </p> soneal on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21528 Sat, 28 May 2011 23:30:07 +0000 soneal 21528@http://forums.themeshaper.com/ <p>Have a look at this article.<br /> <a href="http://www.wpbeginner.com/wp-themes/how-to-add-related-posts-with-a-thumbnail-without-using-plugins/"><br /> <a href="http://www.wpbeginner.com/wp-themes/how-to-add-related-posts-with-a-thumbnail-without-using-plugins/" rel="nofollow">http://www.wpbeginner.com/wp-themes/how-to-add-related-posts-with-a-thumbnail-without-using-plugins/</a> </a></p> <p>This can at least get you moving in the right direction. </p> vicky515 on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21527 Sat, 28 May 2011 22:30:29 +0000 vicky515 21527@http://forums.themeshaper.com/ <p>That wasn't my intention... Rather than write 10 paragraphs of how I think it might be done that I'd update a few times when I got different ideas, I thought it'd be easier to just make a clear statement of what I'd like and compare what I was thinking with the solution that was presented and ask questions. I've seen other people do it. I think Thematic was a bad way to get introduced to Wordpress Themes because I get confused where Wordpress ends and Thematic starts... It's a little overwhelming. So I apologize if it seemed like I was being lazy or something. That is not the case.</p> <p>The loop I currently have (seen below) uses wp_list_pages, so I looked at the codex and didn't see any functionality for getting excerpts. I'm also not sure if I even have it in the best spot. I knew it was supposed to go in the loop, so I tried random places until it worked.</p> <p>I ended up putting it after<br /> <pre><code>edit_post_link(__(&#39;Edit&#39;, &#39;thematic&#39;),&#39;&lt;span class=&quot;edit-link&quot;&gt;&#39;,&#39;&lt;/span&gt;&#39;) ?&gt;</code></pre> <p>in the page.php file.</p> <p>No I'm not sure how to connect functions, I guess.</p> <pre><code>&lt;?php $children = wp_list_pages(&#39;title_li=&#38;child_of=&#39;.$post-&gt;ID.&#39;&#38;echo=0&#39;); if ($children) { ?&gt; &lt;h4&gt;Related Articles&lt;/h4&gt; &lt;ul&gt; &lt;?php echo $children; ?&gt; &lt;/ul&gt; &lt;?php } ?&gt;</code></pre> <p>Having said all that, I think the get_pages you provided is far more useful. I will look into how to get the excerpt.</p> <p>Thank you, and I'm sorry again. </p> helgatheviking on "Listing subpages on parent - as excerpts?" http://forums.themeshaper.com/topic/listing-subpages-on-parent-as-excerpts#post-21523 Sat, 28 May 2011 19:56:00 +0000 helgatheviking 21523@http://forums.themeshaper.com/ <p>that's actually more of a WordPress question than a thematic question... and also the sort of "i need someone to do this for me" type of question that you really shouldn't expect free support for. i don't mean any offense. and if you come up w/ some code that you think is close, but isn't quite working i'd be happy to take a look. </p> <p>the plugins you've found must do a query and get the child pages. then they undoubtedly go through a loop. you could mod the plugin to include the_excerpt() in said loop. </p> <p>OR take a look at the Codex:<br /> <a href="http://codex.wordpress.org/Function_Reference/get_pages" rel="nofollow">http://codex.wordpress.org/Function_Reference/get_pages</a></p> <p>so much info in the codex. right in the middle of the page is an example loop for showing pages that are children of the current page. you'll just need to mod the content appropriately for the excerpt. </p>