Details page: How to move rating stars from sidebar to content area?
This topic contains 25 replies, has 5 voices, and was last updated by Stiofan O’Connor 10 years, 2 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
September 21, 2014 at 3:35 pm #16047
Thanks, Stiofan.
Is the favorite/unfavorite link contained in that list? Judging by the names, it does not look it is.
Do you have a similar list for the tabs in the content section?
I am referring to these elements: Profile, More Info, Reviews, …September 21, 2014 at 3:47 pm #16050That is added via this hook,
add_action('geodir_after_edit_post_link' , 'geodir_add_to_favourite_link',1) ;
You can use remove_action to remove it…
What is it u want to do with the tabs?
September 21, 2014 at 5:20 pm #16057What is it u want to do with the tabs?
Mainly extracting the comments from the tabs and display them below the tabs, as I think that they deserve a more prominent placing.
Also, I would like to reorder the tabs, as I want to have “More Info” as the first tab.September 22, 2014 at 9:40 am #16090Hi wu,
This is how you would remove the reviews tab:(not tested)
EDIT: There is now an option in GD>design>details>Exclude selected tabs from detail pageadd_filter('geodir_detail_page_tab_is_display','geodir_detail_page_tab_is_display_filter',10,2); function geodir_detail_page_tab_is_display_filter($value,$type){ if($type=='reviews'){return false; } else{return $value;} }
This is how you would add comments below tabs
add_action( 'geodir_details_main_content', 'comments_template',65);
this is how you would sort the tabs,
add_filter('geodir_detail_page_tab_list_extend','geodir_detail_page_tab_list_extend_filter',10,1); function geodir_detail_page_tab_list_extend_filter($arr_tabs){ // Do some sorting of the array, maybe user print_r($arr_tabs); to see what is available return $arr_tabs; }
September 22, 2014 at 11:11 am #16105I also want add reviews below tabs, but your code
add_action( 'geodir_details_main_content', 'comments_template',65);
is not working for me and breaks the layout (the sidebar disappear)
September 22, 2014 at 12:22 pm #16113Moving the favorite button works for me, thanks.
Moving the review section breaks the page for me as well.
September 22, 2014 at 1:12 pm #16123sorry i had not tested the code…
Here is a tested veriosn…
add_action( 'geodir_details_main_content', 'comments_template_change_position',65,5); function comments_template_change_position(){ echo comments_template(); }
Stiofan
September 22, 2014 at 3:01 pm #16135I did not test the ordering part yet, but moving the comments works for me. 🙂
September 22, 2014 at 3:25 pm #16136Moving the favorite button works for me, thanks.
Oh, in Safari it seems to break the tabs. All tab contents are visible at once.
September 23, 2014 at 9:42 am #16232Hi, what I’m trying to acomplish is very similar to @wu. I have two things wanting to get clarify.
#1. Moving the following elements to content area:
1. Star Ratings
2. Favorite/Unfavorite
3. Business InfoAnd removed above from sidebar.
Issue: When moving elements altogether only one element takes effect and not all. For example when moving star rating and business info altogether only one appear in details page. It’s either/or and is not all.
I have use provided codes as follow:
/* Add Reviews Below Tabs */ add_action( 'geodir_details_main_content', 'comments_template_change_position',65,5); function comments_template_change_position(){ echo comments_template(); } // remove star rating from sidebar add_filter('geodir_detail_page_sidebar_content', 'geodir_detail_page_sidebar_content_order_myfix',10,1); function geodir_detail_page_sidebar_content_order_myfix($sort){ $elements_to_remove = array('geodir_detail_page_review_rating', 'geodir_add_to_favourite_link', 'geodir_detail_page_more_info'); $sort = array_diff($sort,$elements_to_remove); return $sort; } // add star rating to top of main content add_action('geodir_details_main_content', 'geodir_detail_page_review_rating', 'geodir_add_to_favourite_link', 'geodir_detail_page_more_info');
I have success adding comments below tabs and removed certain elements from sidebar but can not add wanted elements to content area.
#2. I tried to rearrange tabs, however, it’s still showing profile tab as default. How to make other tab as default tab? For example, ‘more info’ tab as default.
Thanks,
NakSeptember 23, 2014 at 9:52 am #16233Hi Nak,
You are using add_action wrong here is a link to how it should work… http://codex.wordpress.org/Function_Reference/add_action
for example
add_action(‘geodir_details_main_content’, ‘geodir_detail_page_review_rating’, 65);
add_action(‘geodir_details_main_content’, ‘geodir_add_to_favourite_link’, 66);
add_action(‘geodir_details_main_content’, ‘geodir_detail_page_more_info’, 67);the number at the end refers to the priority, so a priority 8 would lkely be at the top and priority 100 would be last.
People in general struggle with hooks and filters, it’s not just you 🙂
Stiofan
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket