deftru
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: Contact Form 8] no confirmation or error messagesi have the same problem
Forum: Fixing WordPress
In reply to: wp_list_categories echo current or parent cat on single.phpfound a solution here:
https://www.screenshine.net/blog/1474_wordpress-plugin-show-active-categorywith the changed foreach-loop:
foreach (wp_get_post_categories($post->ID) as $catid) { if (preg_match('#cat-item-' . $catid . '"#', $text)) { $text = str_replace('cat-item-' . $catid . '"', 'cat-item-' . $catid . ' current-cat"', $text); } }
Forum: Fixing WordPress
In reply to: display all subcategories within posts on single.phpnope. writes nothing..
everything else is fine. i just need the parent category. and best outside any loop.
echo(get_category_parents($cat, TRUE, ' » '));
writes for example
category >>
subcat
post
subcat
post
category >> subcategoryForum: Fixing WordPress
In reply to: display all subcategories within posts on single.phpno, that is not the problem.:)
the problem is that the function :
echo "<h1>". $cat->name . "</h1>";
writes 2 categories. one at the beginning – which is good and one at the end (which is a subcategory in category-style) .i think the foreach function is placed wrong. hope u know what i mean.
thx anywayForum: Fixing WordPress
In reply to: display all subcategories within posts on single.phpa little problem..the result is perfect.. just one tiny little thing:
at the end (have a look:
https://www.goodandbad.net/sport-akustik/limited/perfekte-akustik-im-fur-forschung-und-lehre/)
it writes one subcategory (presse)with with the style of the category (<h2>)but i just want to display the parent category with <h2> on top (Ltd.)
<?php $post_categories = wp_get_post_categories( $post->ID ); foreach($post_categories as $c){ $cat = get_category( $c ); echo "<h1>". $cat->name . "</h1>"; $childCats = get_categories( array('child_of' => $c) ); if(is_array($childCats)): foreach($childCats as $child){ ?> <h2><?php echo $child->name; ?></h2> <?php query_posts('cat='.$child->term_id); while(have_posts()): the_post(); $do_not_duplicate = $post->ID; //post code stuff here; endwhile; wp_reset_query(); } endif; } ?>
Presse should not be displayed.
would be glad if this could be fixed.Forum: Fixing WordPress
In reply to: Postionation? Previous & Next for parent Category or SubcategoryAnd how to you get rid of it?
Forum: Fixing WordPress
In reply to: Category Navigation on single.phpa little problem..
the result is perfect.. just one tiny little thing.at the end it writes one subcategory with <h2>
but i just want to display the parent category with <h2> on top (Ltd.)have a look:
https://www.goodandbad.net/sport-akustik/limited/perfekte-akustik-im-fur-forschung-und-lehre/<?php $post_categories = wp_get_post_categories( $post->ID ); foreach($post_categories as $c){ $cat = get_category( $c ); echo "<h1>". $cat->name . "</h1>"; $childCats = get_categories( array('child_of' => $c) ); if(is_array($childCats)): foreach($childCats as $child){ ?> <h2><?php echo $child->name; ?></h2> <?php query_posts('cat='.$child->term_id); while(have_posts()): the_post(); $do_not_duplicate = $post->ID; //post code stuff here; endwhile; wp_reset_query(); } endif; } ?>
Presse should not be displayed.
would be glad if this could be fixed.Forum: Fixing WordPress
In reply to: display all subcategories within posts on single.phpproblem solved!
THIS IS THE FUNCTIONING CODE FROM chinmoy29:<?php $post_categories = wp_get_post_categories( $post->ID ); foreach($post_categories as $c){ $cat = get_category( $c ); echo "<h1>". $cat->name . "</h1>"; $childCats = get_categories( array('child_of' => $c) ); if(is_array($childCats)): foreach($childCats as $child){ ?> <h2><?php echo $child->name; ?></h2> <?php query_posts('cat='.$child->term_id); while(have_posts()): the_post(); $do_not_duplicate = $post->ID; //post code stuff here; endwhile; wp_reset_query(); } endif; } ?>
THX
Forum: Fixing WordPress
In reply to: Category Navigation on single.phpTHIS IS THE FUNCTIONING CODE FROM chinmoy29:
<?php $post_categories = wp_get_post_categories( $post->ID ); foreach($post_categories as $c){ $cat = get_category( $c ); echo "<h1>". $cat->name . "</h1>"; $childCats = get_categories( array('child_of' => $c) ); if(is_array($childCats)): foreach($childCats as $child){ ?> <h2><?php echo $child->name; ?></h2> <?php query_posts('cat='.$child->term_id); while(have_posts()): the_post(); $do_not_duplicate = $post->ID; //post code stuff here; endwhile; wp_reset_query(); } endif; } ?>
THX
Forum: Fixing WordPress
In reply to: Category Navigation on single.phpPERFECT!!!! thank you so much!
I would be glad if I could also understand it;-)
Forum: Fixing WordPress
In reply to: Category Navigation on single.phpthanks chinmoy again!
the fatal error msg:
Fatal error: Call to undefined function: query() in /homepages/4/d188254744/htdocs/sport-akustik/wp-content/themes/Q/left-1.php on line 22thx
Forum: Fixing WordPress
In reply to: Category Navigation on single.phpthanks chinmoy!
the result looks good. unfortunately the posts on the single.php are not going anywhere. it always shows the last post but i can’t go to the e.g. first post of the subcategory..
look at:
https://www.goodandbad.net/sport-akustik/limited/referenz/THX
Forum: Fixing WordPress
In reply to: display all subcategories within posts on single.phphi alchymyth!
thanks 4 your response. i do have a code working on the category.php. but -and i am more webdesigner than programmer ?? – i am not sure why it doesn’t work on the single.php.
maybe you could have a look and help me out: THX
foreach((get_the_category()) as $category) { $postcat= $category->cat_ID; $catname =$category->cat_name; } <h2><?php echo $catname; ?></h2> <?php $categories = get_categories("child_of=5"); foreach ($categories as $cat) { ?> <?php query_posts("cat=$cat->cat_ID&showposts=-1&order=ASC&orderby=name"); ?> <h3><?php single_cat_title(); ?></h3> <?php while (have_posts()) : the_post(); ?> <div class="what"> <h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3> </div> <?php endwhile; ?> <?php } ?>
Forum: Fixing WordPress
In reply to: Category Navigation on single.phpHi David. Thanks for your response. To make it clear look at my textpage :
https://www.goodandbad.net/sport-akustik/category/know-how/
On the left site you see the navigation structure
Title current category
-title subcategory 1
posts within
-title subcategory 2
posts withinand this is what i want to see on my single.php
thanks
Forum: Fixing WordPress
In reply to: Category Navigation on single.php@royalprince: i need the subcategories and the posts within .. but thanks