truongwp
Forum Replies Created
-
Forum: Developing with WordPress
In reply to: How to edit the rss/feed outputThe simplest way is using CSS. Add this to your Additional CSS:
.widget_rss cite { display: none; }
Forum: Plugins
In reply to: [WP Mega Menu] Fatal error when installing pluginOk. Thank you
I meet same error. Please update your plugin. I don’t want to edit plugin code. Thank you.
While wait for plugin is updated, you can use this code in theme to temporary fix it:
https://gist.github.com/truongwp/5fc3570cc2a396cb8cd3933b8bece631Forum: Reviews
In reply to: [Any Posts Widget] Very good!Thank you!
You must place 2 lines
$active = ...
and$parent_active = ...
in foreach block, before echo a term.- This reply was modified 8 years, 5 months ago by truongwp.
Forum: Fixing WordPress
In reply to: How to integrate navbar style into wordpressNo, I want to see the output HTML of navbar you want.
Oh, I missed
'
. Please use below code:
echo '<li><a class="' . $active . ' ' . $parent_active . '" href="' . get_term_link( $product_category ) . '">' . $product_category->name . '</li>';
Can you show the error?
You can write a function to check if you’re in a subterm of a term (I call it is term because this is custom taxonomy, not category).
function is_in_sub_term_page( $parent_id ) { if ( ! is_tax( 'product_cat' ) ) { // If you are not in product cat page, return false. return false; } // Get current term id. $term_object = get_queried_object(); $term_id = $term_object->term_id; // This function check if $term_id is child of $parent_id. return term_is_ancestor_of( $parent_id, $term_id, 'product_cat' ); }
Then use above function like this:
$active = is_tax( 'product_cat', $product_category->slug ) ? 'active' : ''; $parent_active = is_in_sub_term_page( $product_category->term_id ) ? 'parent-active' : ''; echo '<li><a class=" . $active . ' ' . $parent_active . " href="' . get_term_link( $product_category ) . '">' . $product_category->name . '</li>';
You can find used functions in the codex page.
- This reply was modified 8 years, 5 months ago by truongwp.
Forum: Fixing WordPress
In reply to: Removed fixed footer, now footer not 100% widthYou can view your page source in browser and find
</container>
. Or you can find that string in your project files.Forum: Fixing WordPress
In reply to: How to integrate navbar style into wordpressCan you show your nav HTML?
You need to change
is_category($product_category->slug)
in suggested code tois_tax( 'product_cat', $product_category->slug )
. The code above only works with category, not custom taxonomy.Forum: Fixing WordPress
In reply to: How to integrate navbar style into wordpressThis can be useful: https://github.com/twittem/wp-bootstrap-navwalker
Forum: Fixing WordPress
In reply to: Removed fixed footer, now footer not 100% widthI found it. You use
</container>
. It’s not exist and doesn’t match the open tag. Change it to</div>