hungzai
Forum Replies Created
-
The removal of avatar from a single feed works now. Thanks. However the padding don’t seems to be working. There is padding that separates text from picture, text from time, and everything else from the perimeter of the box(and the entire box will have a round corners. So within this box, I would love to reduce/adjust the padding between the information. Thanks for your time John.
Also. The CSS code for removing the author’s avatar seems to apply universally to all my feed on the entire website. I want to retail the avatar in other part of the website but only not show up on a particular column, is that possible? Thanks so much!
Thanks John.
The padding=0 you mentioned is actually padding the entire box of the information displayed to the space outside of the box. But within this box of information, from the information(text or picture) to the perimeter of this box, there is somewhat an all round 20px padding. I would love to work on this padding as I would like to save some space by compressing the information.
The avatar of autohr is removed by the CSS but the empty space awkwardly remains. Any ways I could make the name of the author aligned to left to cover up the empty space left behind by the avatar?
Thanks so much.
Thank you so much for your clarification.
Forum: Fixing WordPress
In reply to: How to remove comma from last item category list?I need help once again to remove the last separator. Can anyone help? Thanks in advance.
<?php foreach (get_the_category() as $cat){ if(cat_is_ancestor_of(16, $cat)){ $parent = get_category($cat->category_parent); $parent_name = $parent->cat_name; echo '<a href="'.get_category_link($parent->cat_ID).'">'; echo $parent->cat_name . ' | </a>'; }}?>Forum: Fixing WordPress
In reply to: Show parents categories of selected child categories.Thanks. I done it. For those who need.
<?php foreach (get_the_category() as $cat){ if(cat_is_ancestor_of(16, $cat)){ $parent = get_category($cat->category_parent); $parent_name = $parent->cat_name; echo '<a href="'.get_category_link($parent->cat_ID).'">'; echo $parent->cat_name . '<p> </a>'; }}?>Forum: Fixing WordPress
In reply to: Show parents categories of selected child categories.I have found this code which says if a category is a grandchild of a grandparent(all the parents are listed under one grandparent), list the category name. But I need the parent(s) name of these grandchildren instead. Anyone can help? Thanks in advance.
<?php foreach((get_the_category()) as $childcat) { if (cat_is_ancestor_of(16, $childcat)) { echo $childcat->cat_name; }} ?>Forum: Fixing WordPress
In reply to: Turn category name into a linkThis code didn’t return parents. The parent’s part is empty. Thanks anyway!
Forum: Fixing WordPress
In reply to: Turn category name into a linkThat didn’t work. Thanks anyway.
Forum: Fixing WordPress
In reply to: How to use separator for listing categories?For those who are keen. Here is the solution.
<?php $args = array('child_of' => 16,'hierarchical' => 0, 'parent' => 16,); $terms = get_terms( 'category', $args ); if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) { $count = count( $terms ); $i = 0; $term_list = '<p class="my-category-list">'; foreach ( $terms as $term ) { $i++; $term_list .= '<a href="' . get_term_link( $term ) . '" title="' . $term->name . '">' . $term->name . '</a>'; if ( $count != $i ) { $term_list .= ' | '; } else { $term_list .= '</p>'; } } echo $term_list; } ?>Forum: Fixing WordPress
In reply to: How to use separator for listing categories?Very good!! Thank you so much!!. However now there is a separator that comes up after the last category. Any idea how to remove that last separator? (sorry for the trouble!)
Yes it works now. Thank you.
Forum: Fixing WordPress
In reply to: Echo produces double output of string.Thanks sterndata but still don’t work.
I got double string because it was also in another child category under the same parent category. Hence both categories pass through the function and hence I get double string output.
Basically what i wanted to achieve is this.
2 child categories(Apples and Orange) under Fruits(parent category).
I want to display it in a column displaying the name Apple if it under Apple category and ‘no’ if it is not. Also for the Orange column, Display Orange if it is in Orange and no if not. Well there are child categories. Problem with this now is both if some other child categories are selected for eg, banana or pineapples are ticked as well, then all of those will pass through and produce a no. Which menas if I ticked 4 child category, there will be no no no no.Forum: Fixing WordPress
In reply to: How to remove comma from last item category list?Just did. Thanks once again.
Forum: Fixing WordPress
In reply to: How to remove comma from last item category list?It did. Thank you so much. I didn’t know where to input the ID of the parent category. Found it and works perfectly now. Thanks once again.