rhoi
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: Old Permalink will automatically 301 redirects?Thank you sir
Forum: Fixing WordPress
In reply to: categoryname.domainname.comanyone knows how to do this?
Forum: Fixing WordPress
In reply to: Category Description for Ratingshi keesiemeijer do you know now how to solve my problem?
Forum: Fixing WordPress
In reply to: Category Description for RatingsYes it’s a plugin.
I paste the code here
https://pastebin.com/gFdk9WxdForum: Fixing WordPress
In reply to: Category Description for RatingsI noticed that since we did this in the loop our output are sorted by Category Name Ascending. Not sorted by ratings. weird right.
Forum: Fixing WordPress
In reply to: Category Description for RatingsI did what you said, I deactivated all the plugins but the sorting are still the same. Yes the output of the rating is visible in my page but the sorting is not correct.
BTW I put this loop inside the taxonomy page. coz I’m using the taxonomy picker so the result should display in the taxonomy page.
wordpress 3.5.2
Forum: Fixing WordPress
In reply to: Category Description for RatingsSir still not working, the arrangement are still the same.
The result is sorted by Category name not by ratings.Forum: Fixing WordPress
In reply to: Category Description for RatingsThis is the code, still didn’t work
if ( have_posts() ) : while ( have_posts() ) : the_post(); $post_terms = get_the_terms( $post->ID, 'branding' ); if ( $post_terms ) { $post_terms = array_values( $post_terms ); $include = array(); // terms that have a numeric description bigger than 0 foreach ( $post_terms as $key => $term ) { $desc = absint( $term->description ); if ( $desc ) { $include[$key] = $desc; } else { unset( $post_terms[ $key ] ); } } if ( $post_terms ) { // sort the terms // SORT_ASC - sort items ascendingly. // SORT_DESC - sort items descendingly. array_multisort( $include, SORT_ASC, $post_terms ); $post_terms = array_reverse($post_terms); foreach ( $post_terms as $term ) { echo $term->name; echo ' rating = ' . $term->description; echo ' - '; the_title(); echo '<Br>'; } } } endwhile; endif;
Forum: Fixing WordPress
In reply to: Category Description for RatingsStill no luck.
sorry I’m not really good in programming.Forum: Fixing WordPress
In reply to: Category Description for RatingsHi,keesiemeijer
The loop works on my part except the sort items for the ratings.
The sorting couldn’t change whether I use SORT_DESC or SORT_ASC.The rating always like this.
CategoryName, rating = 2.1
CategoryName, rating = 3.3
CategoryName, rating = 4.45I would like to be like this
The rating always like this.
CategoryName, rating = 4.45
CategoryName, rating = 3.3
CategoryName, rating = 2.1Thanks keesiemeijer in advance
Forum: Fixing WordPress
In reply to: Category Description for RatingsYes, I want to show the branding categories and ratings in the loop. The loop is sorted by ratings.
Forum: Fixing WordPress
In reply to: Category Description for RatingsWhat if I’m going to use this in loop. I tried everything to insert the above code in loop but it didn’t work. please help me.
if ( have_posts() ) : while ( have_posts() ) : the_post(); endwhile; endif;
Forum: Fixing WordPress
In reply to: Category Description for RatingsIt’s f*****g awesome. It works.
Thank for the code keesiemeijerI just added $cats before the get_terms
<?php add_filter( 'terms_clauses', 'query_term_ratings', 10, 3 ); $cats = get_terms( 'branding', array( 'order' => 'asc', 'number' => '6' ) ); remove_filter( 'terms_clauses', 'query_term_ratings', 10, 3 ); if ( !( is_wp_error( $cats ) || empty( $cats ) ) ) { foreach ( $cats as $cat ) { $desc = absint( $cat->description ); if ( $desc ) { echo 'category = ' . $cat->name; echo 'rating = ' . $desc; } } } ?>
Forum: Fixing WordPress
In reply to: How to remove specific content in single pageI found a solution now. I installed a plugin named secondary content plugin. It helps me to solve my problem.
Forum: Fixing WordPress
In reply to: How to remove specific content in single pageDo you have any solutions that doesn’t need to add a html code. The user is not a coder.