akis
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: WP-EMail] Two small problemsOr better.. to move the form to single.php ?
Forum: Plugins
In reply to: [Plugin: WP-EMail] Two small problemsI resolved the problem with
$_SERVER["REQUEST_URI"]
andstristr()
function.
Now, another:
There is any way that I can display the content below the form?Forum: Plugins
In reply to: [Plugin: WP-EMail] Two small problemsI’m not sure you understand what I mean.
Form page -> wp-email plugin form (that one with your name, friends name and so on).About 2.. well.. I don’t receive an error on submit, just don’t arrive on Yahoo! mail box.
Thanks for your help.
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryI forgot about this thread so here it is my code, Klarabella.
Maybe there is a simple way for this, but it’s working.$category = get_the_category(); $cat_term_id = $category[0]->term_id; $cat_category_parent = $category[0]->category_parent; $listcat = wp_list_categories('echo=0&child_of='.$cat_category_parent.'&title_li='); $listcat = str_replace("cat-item-".$cat_term_id, "cat-item-".$cat_term_id." current-cat", $listcat); if ( in_category( $cat_term_id ) || post_is_in_descendant_category( $cat_term_id )) { echo $listcat; }
post_is_in_descendant_category function
function post_is_in_descendant_category( $cats, $_post = null ) { foreach ( (array) $cats as $cat ) { $descendants = get_term_children( (int) $cat, 'category'); if ( $descendants && in_category( $descendants, $_post ) ) return true; } return false; }
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryYes, but I already solved this.
Thanks again for such a piece of code.Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryIt is possible to display the same menu on category child posts?
Forum: Fixing WordPress
In reply to: How can I check if is the last post?Thanks for the clear explanation, T31os. As always.
I thought that I missed a function which return this kinda value.Forum: Fixing WordPress
In reply to: How can I check if is the last post?Scenario:
Posts per page: 10
Going to the last page of posts (2 posts only on that page) it displays 10.Forum: Fixing WordPress
In reply to: How can I check if is the last post?get_option(‘posts_per_page’) doesn’t help.
It’s display the posts per page from wp-admin.Forum: Fixing WordPress
In reply to: How to redirect category to first available subcategory (child)Thanks.
Now I have the following code:$thiscategory = get_query_var('cat'); $catkids = get_categories("child_of=".$thiscategory."&sort_column=menu_order"); if ($catkids) { $firstchild = $catkids[0]; wp_redirect(get_permalink($firstchild->ID)); }
The problem is $firstchild->ID I think, get_permalink should be replaced with something like get_category_link.
Problem solved, $firstchild->ID should be replace with $firstchild->term_id and of course get_category_link.
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryIt works! Thanks so much!
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryMany thanks, now it works as it should.
I have tried to remove the while but doesn’t seem to work correctly without it.Sorry for by bad english.
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryThanks, but, how can I stop parent categories from being displayed if current category has no childs or has no posts under child?
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryedited.
Forum: Fixing WordPress
In reply to: Showing subcategories of a parent page under subcategoryI’m using just the first part, before else and it works fine if category has 1+ childs WITH posts.
If not it displays all parent categories and it’s not exactly what I want – just hide them.Thanks so much for your help.