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: category http://forums.themeshaper.com/ Help In Shaping WordPress Themes en Mon, 25 May 2015 19:31:28 +0000 helgatheviking on "custom tax+category to filter posts" http://forums.themeshaper.com/topic/custom-taxcategory-to-filter-posts#post-27336 Thu, 07 Jun 2012 18:36:04 +0000 helgatheviking 27336@http://forums.themeshaper.com/ <p>please note that thematic has moved to <a href="http://www.thematictheme.com" rel="nofollow">www.thematictheme.com</a> </p> <p>but that is pretty clearly not a thematic question. if i understand you correctly i think you are looking into url rewrites which can be brutal and somewhat similar to straight up voodoo </p> gillispj on "custom tax+category to filter posts" http://forums.themeshaper.com/topic/custom-taxcategory-to-filter-posts#post-27312 Tue, 05 Jun 2012 21:57:01 +0000 gillispj 27312@http://forums.themeshaper.com/ <p>Hi Thematic Community,</p> <p>So far it has been a pleasure building in thematic and this is the only way I build in WP now. However I am really struggling with this problem I am having with Custom Taxonomies in WP. I know likely my answer is in the WP forums but I have tried there a couple of times to no avail and I am wondering if someone here has an answer.</p> <p>Basically I am building a site for a college and I promised to have in in each program page a secondary menu that filters posts based on the custom tax (program) in combination with parent category (ie news).</p> <p>I thought I would just make a custom url like <a href="http://www.school.edu/programs/fine-art/news" rel="nofollow">www.school.edu/programs/fine-art/news</a> however this just brings up 404.</p> <p>Am I completely missing the point here? What am I doing wrong? </p> helgatheviking on "Creating special archive page that excludes just one category" http://forums.themeshaper.com/topic/creating-special-archive-page-that-excludes-just-one-category#post-27071 Mon, 21 May 2012 19:46:18 +0000 helgatheviking 27071@http://forums.themeshaper.com/ <p>the archives template currently shows posts by category and by date. but to modify this particular template, you could override the thematic_category_archives() function like so:</p> <pre><code>function childtheme_override_category_archives() { ?&gt; &lt;li id=&quot;category-archives&quot; class=&quot;content-column&quot;&gt; &lt;h2&gt;&lt;?php _e(&#39;Archives by Category&#39;, &#39;thematic&#39;) ?&gt;&lt;/h2&gt; &lt;ul&gt; &lt;?php wp_list_categories(&#39;optioncount=1&#38;feed=RSS&#38;title_li=&#38;show_count=1&#38;exclude=8&#39;) ?&gt; &lt;/ul&gt; &lt;/li&gt; &lt;?php }</code></pre> <p>but if that's not what you want, then you could create your own template to do whatever you wanted. there are probably several decent plugins that do better archives than the thematic or WP defaults. also, image only posts could now be of the image, "post format". thematic doesn't have them by default yet, but they're easy enough to add and make a lot more sense than being in a specific category. </p> semisara on "Creating special archive page that excludes just one category" http://forums.themeshaper.com/topic/creating-special-archive-page-that-excludes-just-one-category#post-27069 Mon, 21 May 2012 16:48:19 +0000 semisara 27069@http://forums.themeshaper.com/ <p>Bumping this.. any links to relevant information or advice? </p> semisara on "Creating special archive page that excludes just one category" http://forums.themeshaper.com/topic/creating-special-archive-page-that-excludes-just-one-category#post-27041 Thu, 17 May 2012 19:15:37 +0000 semisara 27041@http://forums.themeshaper.com/ <p>First of all I'm going to apologise for asking what is probably a stupid question. I've created Wordpress themes before, but since the age of Thematic I've begun to leave it to the pros and now I'm lost when trying to tweak.</p> <p>My website (http://www.simpletribe.net/) is composed of two types of posts: picture-only posts that are all tagged in the category "one shot" (category ID 8), and picture and text posts that are placed into a variety of categories. I'd like to create a single page that uses the archive template to display all posts EXCEPT ones in category 8, making it easier for readers to find text posts.</p> <p>I'm *assuming* I should be working with either the archives.php "Archive" code, or the archive.php "Archives Page Page Template" code. Unfortunately I'm not sure which one I should copy into a new template php file, and I'm not sure how to edit the code to exclude only category 8. </p> <p>Can anyone point me in the correct direction? </p> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26695 Sat, 28 Apr 2012 14:05:13 +0000 colfelt 26695@http://forums.themeshaper.com/ <p>Ahh, that old chestnut... </p> helgatheviking on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26693 Sat, 28 Apr 2012 13:52:41 +0000 helgatheviking 26693@http://forums.themeshaper.com/ <p>no bacon is very unsatisfactory. always more than 1 way to skin the cat b/c we could probably go back to what you started with</p> <pre><code>function remove_thematic_categoryloop() { remove_action(&#39;thematic_categoryloop&#39;, &#39;thematic_category_loop&#39;); } add_action(&#39;init&#39;, &#39;remove_thematic_categoryloop&#39;); function kia_categoy_loop(){ if(is_category(&#39;bacon&#39;)){ //bacon loop here } else { thematic_category_loop(); } add_action(&#39;thematic_categoryloop&#39;,&#39;kia_category_loop&#39;);</code></pre> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26692 Sat, 28 Apr 2012 10:26:38 +0000 colfelt 26692@http://forums.themeshaper.com/ <p>Ah, yes. That's better. I figured there must've been a walking donut there. That loop had completely disappeared up it's own rear. And it didn't have ANY bacon in it, which is, well, unsatisfactory.</p> <p>As ever, Helga, thank you. You're awesome. :) </p> helgatheviking on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26655 Thu, 26 Apr 2012 01:50:56 +0000 helgatheviking 26655@http://forums.themeshaper.com/ <p>not bacon! :) well i have to apologize b/c i think i messed up. </p> <p>basically thematic does this:</p> <pre><code>if (function_exists(&#39;childtheme_override_category_loop&#39;)) { function thematic_category_loop() { childtheme_override_category_loop(); } }</code></pre> <p>so if the override is defined then thematic's default becomes the override. which means the original thematic_category_loop doesn't exist anymore and you just end up in a loop of loops. </p> <p>my else statement<br /> <pre><code>else { thematic_category_loop() }</code></pre> <p>is just pointing to childtheme_override_category_loop which points to thematic_category_loop and on and on. </p> <p>so the override should be</p> <pre><code>function childtheme_override_category_loop(){ if(is_category(&#39;bacon&#39;)){ //put your special bacon loop here } else { //put default category loop here } }</code></pre> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26653 Wed, 25 Apr 2012 23:04:04 +0000 colfelt 26653@http://forums.themeshaper.com/ <p>Yeah I'm using 0.9.8, but no joy. Ah well, the less streamlined version is working OK. It just bugs me that something that *should* work, doesn't. It's just not bacon. </p> helgatheviking on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26629 Wed, 25 Apr 2012 13:26:49 +0000 helgatheviking 26629@http://forums.themeshaper.com/ <p>can't see anything in your code, but first off make sure you are using this version of thematic:<br /> developing.thematic4you.com/thematic-development-release/</p> <p>as there were some problems w/ the add_action that got resolved. </p> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26621 Wed, 25 Apr 2012 05:17:41 +0000 colfelt 26621@http://forums.themeshaper.com/ <p>OK... so I've been working with Helga's cleaner code. But, It's not playing nicely with me. I find that the two loops I have defined in it work fine. But then the normal thematic_category_loop doesn't seem to work. The categories that should run that loop don't seem to run any loop at all. So, it made me wonder, doesn't specifying childtheme_override_category_loop tell the original thematic_category_loop to go use childtheme_override_category_loop instead? Therefore, flying up it's own backside? Maybe it doesn't work that way. But it was the best explanation I could come up with to explain why the code below didn't work. Can you spot anything that looks like it would prevent the thematic_category_loop from working?</p> <pre><code>// remove the standard loop function childtheme_override_category_loop(){ // get the name of the category and store it in the variable $catslug $cat = get_query_var(&#39;cat&#39;); $yourcat = get_category ($cat); $catslug = $yourcat-&gt;slug; if (is_category(&#39;testimonials&#39;)){ query_posts(&#39;category_name=&#39;.$catslug); if (have_posts()) : while (have_posts()) : the_post(); ?&gt; &lt;h1 class=&quot;entry-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt; &lt;div class=&quot;entry-content&quot;&gt;&lt;?php the_content(); ?&gt;&lt;/div&gt; &lt;?php endwhile; endif; } elseif (is_category(&#39;menus&#39;)) { // loop for the content within the current category, // which has a custom field &#39;intro_article&#39; which is equal to 1 $handmade_query = new WP_Query(&#39;category_name=&#39;.$catslug.&#39;&#38;meta_key=intro_article&#38;meta_value=1&#39;); while ($handmade_query-&gt;have_posts()) : $handmade_query-&gt;the_post(); ?&gt; &lt;h1 class=&quot;entry-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt; &lt;div class=&quot;entry-content&quot;&gt;&lt;?php the_content(); ?&gt;&lt;/div&gt; &lt;?php endwhile; wp_reset_postdata(); ?&gt; &lt;?php // now loop to create an unordered list of the other posts in the category // but which have a custom field &#39;intro_article&#39; which is equal to 0 ?&gt; &lt;ul id=&quot;sub-nav-ul&quot;&gt; &lt;?php query_posts(&#39;category_name=&#39;.$catslug.&#39;&#38;meta_key=intro_article&#38;meta_value=0&#39;); if (have_posts()) : while (have_posts()) : the_post(); ?&gt; &lt;li id=&quot;sub-nav&quot; class=&quot;entry-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt; &lt;?php the_post_thumbnail(array(70,70));?&gt;&lt;span&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php endwhile; endif; ?&gt;&lt;/ul&gt; &lt;?php wp_reset_postdata(); } else { thematic_category_loop(); } }</code></pre> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26620 Wed, 25 Apr 2012 04:58:26 +0000 colfelt 26620@http://forums.themeshaper.com/ <p>Cool beans. Thanks Helga! </p> helgatheviking on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26617 Wed, 25 Apr 2012 03:46:28 +0000 helgatheviking 26617@http://forums.themeshaper.com/ <p>you got it. everything is better with bacon. yes, look through the extensions folder. you'll see plenty of places where it is set up to run childtheme_override_whatever in place of thematic_whatever. the overrides are far more intuitive than filters, but not always the best solution. usually depends on how much you need to change... or if there is a filter available. </p> helgatheviking on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26618 Wed, 25 Apr 2012 03:46:28 +0000 helgatheviking 26618@http://forums.themeshaper.com/ <p>you got it. everything is better with bacon. yes, look through the extensions folder. you'll see plenty of places where it is set up to run childtheme_override_whatever in place of thematic_whatever. the overrides are far more intuitive than filters, but not always the best solution. usually depends on how much you need to change... or if there is a filter available. </p> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26613 Wed, 25 Apr 2012 00:30:47 +0000 colfelt 26613@http://forums.themeshaper.com/ <p>Well, clearly that's much more elegant. And anything that has bacon in it has to be good, right?</p> <p>So, the function childtheme_override_whateverfunction. That can be used to? Let me guess, override any function you can find that says thematic_whateverfunction? </p> helgatheviking on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26598 Tue, 24 Apr 2012 15:02:52 +0000 helgatheviking 26598@http://forums.themeshaper.com/ <p>as a general set up what about:</p> <pre><code>function childtheme_override_category_loop(){ if(is_category(&#39;bacon&#39;)){ //put your special bacon loop here } else { thematic_category_loop(); } }</code></pre> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26595 Tue, 24 Apr 2012 12:48:02 +0000 colfelt 26595@http://forums.themeshaper.com/ <p>OK... I think I have it. Just in case someone else may find this helpful I'm pasting the code below.</p> <pre><code>// remove the standard loop function remove_thematic_categoryloop() { remove_action(&#39;thematic_categoryloop&#39;, &#39;thematic_category_loop&#39;); } add_action(&#39;init&#39;, &#39;remove_thematic_categoryloop&#39;); // get the name of the category and store it in the variable $catslug function add_handmade_intro_categoryloop() { if (is_category( )) { $cat = get_query_var(&#39;cat&#39;); $yourcat = get_category ($cat); $catslug = $yourcat-&gt;slug; // if this isn&#39;t in the menus category, do a normal loop if (!is_category(&#39;menus&#39;)){ query_posts(&#39;category_name=&#39;.$catslug); if (have_posts()) : while (have_posts()) : the_post(); ?&gt; &lt;h1 class=&quot;entry-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt; &lt;div class=&quot;entry-content&quot;&gt;&lt;?php the_content(); ?&gt;&lt;/div&gt; &lt;?php endwhile; endif; wp_reset_postdata(); } // if it is in the category &#39;menus&#39; then do these special loops if (is_category(&#39;menus&#39;)) { // loop for the content within the current category, // which has a custom field &#39;intro_article&#39; which is equal to 1 $handmade_query = new WP_Query(&#39;category_name=&#39;.$catslug.&#39;&#38;meta_key=intro_article&#38;meta_value=1&#39;); while ($handmade_query-&gt;have_posts()) : $handmade_query-&gt;the_post(); ?&gt; &lt;h1 class=&quot;entry-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt; &lt;div class=&quot;entry-content&quot;&gt;&lt;?php the_content(); ?&gt;&lt;/div&gt; &lt;?php endwhile; wp_reset_postdata(); ?&gt; &lt;?php // now loop to create an unordered list of the other posts in the category // but which have a custom field &#39;intro_article&#39; which is equal to 0 ?&gt; &lt;ul id=&quot;sub-nav-ul&quot;&gt; &lt;?php query_posts(&#39;category_name=&#39;.$catslug.&#39;&#38;meta_key=intro_article&#38;meta_value=0&#39;); if (have_posts()) : while (have_posts()) : the_post(); ?&gt; &lt;li id=&quot;sub-nav&quot; class=&quot;entry-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt; &lt;?php the_post_thumbnail(array(70,70));?&gt;&lt;span&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php endwhile; endif; ?&gt;&lt;/ul&gt; &lt;?php } } } add_action(&#39;thematic_categoryloop&#39;, &#39;add_handmade_intro_categoryloop&#39;);</code></pre> colfelt on "a loop that runs only on one category archive" http://forums.themeshaper.com/topic/a-loop-that-runs-only-on-one-category-archive#post-26591 Tue, 24 Apr 2012 10:39:22 +0000 colfelt 26591@http://forums.themeshaper.com/ <p>Hi all,</p> <p>I am trying to call a function/loop specific to one category archive page. What I've done, is to remove the standard loop within my child-theme's functions.php, then replaced it with my 'special' loop.</p> <p>So far, I have cracked getting that 'special' loop to work nicely. But what I want to do now, is to only run the function which rips out the normal loop when we are on the category archive of a particular category ('menus').</p> <p>Here's my code:</p> <pre><code>// remove the standard loop function remove_thematic_categoryloop() { remove_action(&#39;thematic_categoryloop&#39;, &#39;thematic_category_loop&#39;); } add_action(&#39;init&#39;, &#39;remove_thematic_categoryloop&#39;); // get the name of the category and store it in the variable $catslug function add_handmade_intro_categoryloop() { if (is_category( )) { $cat = get_query_var(&#39;cat&#39;); $yourcat = get_category ($cat); $catslug = $yourcat-&gt;slug; // loop for the content within the current category, // which has a custom field &#39;intro_article&#39; which is equal to 1 $handmade_query = new WP_Query(&#39;category_name=&#39;.$catslug.&#39;&#38;meta_key=intro_article&#38;meta_value=1&#39;); while ($handmade_query-&gt;have_posts()) : $handmade_query-&gt;the_post(); ?&gt; &lt;h1 class=&quot;entry-title&quot;&gt;&lt;?php the_title(); ?&gt;&lt;/h1&gt; &lt;div class=&quot;entry-content&quot;&gt;&lt;?php the_content(); ?&gt;&lt;/div&gt; &lt;?php endwhile; wp_reset_postdata(); ?&gt; &lt;?php // now loop to create an unordered list of the other posts in the category // but which have a custom field &#39;intro_article&#39; which is equal to 0 ?&gt; &lt;ul id=&quot;sub-nav-ul&quot;&gt; &lt;?php query_posts(&#39;category_name=&#39;.$catslug.&#39;&#38;meta_key=intro_article&#38;meta_value=0&#39;); if (have_posts()) : while (have_posts()) : the_post(); ?&gt; &lt;li id=&quot;sub-nav&quot; class=&quot;entry-title&quot;&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot; rel=&quot;bookmark&quot; title=&quot;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&quot;&gt; &lt;?php the_post_thumbnail(array(70,70));?&gt;&lt;span&gt;&lt;?php the_title(); ?&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt; &lt;?php endwhile; endif; ?&gt;&lt;/ul&gt; &lt;?php } } add_action(&#39;thematic_categoryloop&#39;, &#39;add_handmade_intro_categoryloop&#39;);</code></pre> <p>So, I've tried to put in some "if (is_category('menus'))" stuff in before the function, which didn't work... and I have subsequently hit a wall and need some inspiration. I only want to call these functions if the category is 'menus'...</p> <p>Can anybody help me get over this hump? it would save me some hair. Thanks! </p> helgatheviking on "Checking if you are on a category AND a specific page ID / page name" http://forums.themeshaper.com/topic/checking-if-you-are-on-a-category-and-a-specific-page-id-page-name#post-26049 Wed, 21 Mar 2012 23:45:00 +0000 helgatheviking 26049@http://forums.themeshaper.com/ <p>i still kind of think you should make the switch to using a category template, but that is good info to know. i've been stuck there before myself. </p> sixfootjames on "Checking if you are on a category AND a specific page ID / page name" http://forums.themeshaper.com/topic/checking-if-you-are-on-a-category-and-a-specific-page-id-page-name#post-26047 Wed, 21 Mar 2012 20:12:53 +0000 sixfootjames 26047@http://forums.themeshaper.com/ <p>Hi Helga,</p> <p>I thought it was something to do my misunderstanding of Thematic because I had tried a hundred different options before I posted and nothing was working.</p> <p>Anyway, this finally did the trick.</p> <pre><code>function add_below_the_post () { global $post; $category = get_the_category(); $category = $category[0]-&gt;category_nicename; global $pagename; //this is what I needed to check the page name I am on $news_page_name = $pagename; if (!is_wp_error($category)) { if ($category == &#39;student-stories&#39;) { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/people/student-stories/&quot;&gt;Return to &#39; .$category .&#39;&lt;/a&gt;&#39;); } else if ($category == &#39;news&#39; &#38;&#38; $news_page_name != &#39;news-events&#39;) { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/news/news-events/&quot;&gt;Return to &#39; .$category .&#39;&lt;/a&gt;&#39;); } else if ($category == &#39;research&#39;) { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/research/research-snippet/&quot;&gt;Return to &#39; .$category .&#39; snippets&lt;/a&gt;&#39;); } } } add_action(&#39;thematic_belowpost&#39;, &#39;add_below_the_post&#39;);</code></pre> <p>Thanks for the help! </p> helgatheviking on "Checking if you are on a category AND a specific page ID / page name" http://forums.themeshaper.com/topic/checking-if-you-are-on-a-category-and-a-specific-page-id-page-name#post-26042 Wed, 21 Mar 2012 13:18:07 +0000 helgatheviking 26042@http://forums.themeshaper.com/ <p>just b/c you can't get your conditionals right... that doesn't make it a thematic issue. </p> <p>looks like you're getting turned around b/c you are using a page template to display a particular category? the blog template is being deprecated, b/c you already have a template for displaying categories... it is called category.php. (which calls thematic_category_loop() )</p> <p>anyway, i suspect you are doing a new query on this page template. when that happens you obliterate the old query... and in your new loop (where you are accessing thematic_belowpost() ) all the $post data is now the $post data for the newly queried posts and it no longer knows that you are even ON a page template... so conditionally checking for a template will always be false. </p> <p>anyway that's the best i can do for now since i am confused by your implementation of page templates on what seems like single posts? or maybe category archives? and calling things pages when a page is something particular in WP and doesn't have categories. explain further and i might be able to help further.</p> <p>have you tried echoing out :</p> <pre><code>$category = get_the_category(); $category = $category[0]-&gt;category_nicename; echo &quot;the category is = &quot; . $category;</code></pre> <p>to see what you are getting? </p> sixfootjames on "Checking if you are on a category AND a specific page ID / page name" http://forums.themeshaper.com/topic/checking-if-you-are-on-a-category-and-a-specific-page-id-page-name#post-26040 Wed, 21 Mar 2012 09:42:00 +0000 sixfootjames 26040@http://forums.themeshaper.com/ <p>Hi,</p> <p>I am trying to add a url link on certain pages with a certain category but exclude it from other pages who might have that category but is of a certain page name or even using a certain template page.</p> <p>I've tried many many different options and asked for help with this on the WP forums too but this leaves me to believe it's not working because I am using Thematic.</p> <p>Please see this snippet of code and what I am trying to sort out relating to the category "News". </p> <pre><code>function add_below_the_post () { $category = get_the_category(); $category = $category[0]-&gt;category_nicename; if (!is_wp_error($category)) { if ($category == &#39;student-stories&#39;) { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/people/student-stories/&quot;&gt;Return to &#39; .$category .&#39;&lt;/a&gt;&#39;); } else if ($category == &#39;news&#39;) { if (is_page_template(&#39;template-page-news.php&#39;)) { echo(&#39;WORKING&#39;); //here is where I want to exclude the link if it&#39;s using a certain template } else { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/news/news-events/&quot;&gt;Return to &#39; .$category .&#39;&lt;/a&gt;&#39;); } } else if ($category == &#39;research&#39;) { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/research/research-snippet/&quot;&gt;Return to &#39; .$category .&#39; snippets&lt;/a&gt;&#39;); } } } add_action(&#39;thematic_belowpost&#39;, &#39;add_below_the_post&#39;);</code></pre> <p>There is a section in the code above where you will see I am trying to exclude the link but replaced it with a string called 'WORKING' just to test it. </p> <p>I have tried everything from is_page(16); is_page('news_events') to is_page_template('template-page-news.php'). I have also tried this...</p> <pre><code>else if ($category == &#39;news&#39; &#38;&#38; !is_page(&#39;news-events&#39;)) { echo(&#39;&lt;a class=&quot;postFootLink&quot; href=&quot;&#39; .site_url() .&#39;/news/news-events/&quot;&gt;Return to &#39; .$category .&#39;&lt;/a&gt;&#39;); }</code></pre> <p>which doesn't work either. I'd really appreciate some insight into this please.</p> <p>Thanks ;) </p> helgatheviking on "full post and then excerpts on category pages" http://forums.themeshaper.com/topic/full-post-and-then-excerpts-on-category-pages#post-25084 Mon, 30 Jan 2012 15:02:00 +0000 helgatheviking 25084@http://forums.themeshaper.com/ <p>cool share. i will have to check that out, i've been wondering how to do that myself. </p> petskratt on "full post and then excerpts on category pages" http://forums.themeshaper.com/topic/full-post-and-then-excerpts-on-category-pages#post-25083 Mon, 30 Jan 2012 12:06:44 +0000 petskratt 25083@http://forums.themeshaper.com/ <p>grrreat, thanks for code sample :-)</p> <p>and now to answer the original question with said sample - this modification will show first post on category archive as full and rest as excerpts:</p> <pre><code>// category pages with full content function childtheme_content( $content ) { global $loopcounter; if ( is_category() &#38; !$loopcounter ) { $content= &#39;full&#39;; $loopcounter++; } return $content; } add_filter( &#39;thematic_content&#39;, &#39;childtheme_content&#39; );</code></pre> helgatheviking on "Filtering One Category from Index Loop" http://forums.themeshaper.com/topic/filtering-one-category-from-index-loop#post-24705 Fri, 06 Jan 2012 22:25:26 +0000 helgatheviking 24705@http://forums.themeshaper.com/ <p>evolving further, i like this method of hooking into pre_get_posts() the best:</p> <p><a href="http://codex.wordpress.org/Custom_Queries#Category_Exclusion" rel="nofollow">http://codex.wordpress.org/Custom_Queries#Category_Exclusion</a></p> <p>i'd probably go so far as to say this is currently the definitive method for modifying an existing/default query. query_posts is still the perfect choice for multiple loops.</p> <pre><code>add_action(&#39;pre_get_posts&#39;, &#39;kia_exclude_category&#39; ); function kia_exclude_category( ){ global $wp_query; $excluded_id = 15; // only exclude on home page if( is_home()) { $wp_query-&gt;query_vars[&#39;cat&#39;] = &#39;-&#39; . $excluded_id; } }</code></pre> Sabra on "Category archive showing wrong posts" http://forums.themeshaper.com/topic/category-archive-showing-wrong-posts#post-24302 Wed, 14 Dec 2011 12:47:39 +0000 Sabra 24302@http://forums.themeshaper.com/ <p>Hi everyone,</p> <p>I have a child theme based on Thematic and just noticed that my category archive is showing the wrong posts, not the posts that are in the category. Does anyone know what going on here? I haven't altered or copied the category.php file.</p> <p>Take care,<br /> Sabra </p> helgatheviking on "is it possible organize some posts alphabetically, others by date?" http://forums.themeshaper.com/topic/is-it-possible-organize-some-posts-alphabetically-others-by-date#post-24087 Sat, 03 Dec 2011 17:07:27 +0000 helgatheviking 24087@http://forums.themeshaper.com/ <p>you functions.php <em>is</em> a plugin of sorts. it interacts with the WP core as well as with thematic. it was only meant as <em>example</em> code.</p> <p>yes, storing a group of data into 1 variable is an array and in your case would be more efficient/elegant than any other way of coding it. you can see that is_category() does accept an array in the Codex. SO much information there</p> <p><a href="http://codex.wordpress.org/Conditional_Tags#A_Category_Page" rel="nofollow">http://codex.wordpress.org/Conditional_Tags#A_Category_Page</a></p> <p>and you should bookmark the conditional logic page b/c i can almost guarantee you'll need it a lot. i do. </p> onelittlemoose on "is it possible organize some posts alphabetically, others by date?" http://forums.themeshaper.com/topic/is-it-possible-organize-some-posts-alphabetically-others-by-date#post-24086 Sat, 03 Dec 2011 15:40:35 +0000 onelittlemoose 24086@http://forums.themeshaper.com/ <p>That's a relief, that I don't have to write a plugin. </p> <p>Now here's my next question: in my case there are multiple categories that I want to organize alphabetically. About 15 at the moment, likely more to add (it's a directory). Would it make sense to pile those categories up into one variable - it think that's called an "array"? (don't know how to do that yet, but working thru the logic)</p> <p>Many thanks. </p> helgatheviking on "is it possible organize some posts alphabetically, others by date?" http://forums.themeshaper.com/topic/is-it-possible-organize-some-posts-alphabetically-others-by-date#post-24076 Fri, 02 Dec 2011 22:54:48 +0000 helgatheviking 24076@http://forums.themeshaper.com/ <p>"For our first example, let's consider a glossary plugin that will let the site owner put posts in a specific "glossary" category (saved by the plugin in global variable $gloss_category). "</p> <p>which is saying that somewhere in the plugin settings (b/c this example presumes a plugin) this variable is defined. if you aren't writing a plugin, you can simply define the variable right there ($gloss_category = 'bacon') or eliminate it completely. for instance:</p> <pre><code>if( is_category( &#39;bacon&#39; )) { // alphabetical order by post title return &quot;post_title ASC&quot;; }</code></pre> <p>which will only effect the bacon category. </p>