Home › Forums › Calendar Products › Events Calendar PRO › SORT ALPHABETICALLY + CHANGE TITLE
- This topic has 6 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
July 14, 2015 at 9:36 pm #986512
anywherefest
ParticipantHi
I have searched through the forums for answers but no luck. Two questions:
1. I want to use this snippet (it’s working perfectly for list view- thanx;) for Photo view- I’ve just switched list for photo to no avail…any ideas:
/*
* The Events Calender – Custom Orderby Events in List View ByTitle
* http://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters
*/
add_filter( ‘pre_get_posts’, ‘tribe_change_event_order_list_view’, 99 );
function tribe_change_event_order_list_view( $query ) {if ( tribe_is_past() || tribe_is_upcoming() ) {
$query->set( ‘orderby’, ‘title’ );
$query->set( ‘order’, ‘ASC’ );
}
return $query;
}and 2. I have tried exchanging: <?php echo tribe_get_events_title() ?> to my preferred title in list/content.php but it’s not working. Is there a snippet I can include in functions.php that will rename my events page from EVENTS to something else? I’ve tried a few but no luck either.
Many thanks.
July 15, 2015 at 9:39 am #986667Nico
MemberHi Alex,
Thanks for reaching out to us! I’ll try to help you out on these questions!
#1 – Regarding the photo view ordering, please take a look at this thread, where Brian explains how ordering actually works for photo view, and please let me know about it.
#2 – You can filter the returned title by this function, but it’s not clear to me if you want to change this just in ‘list’ view or all over your site?
Best,
NicoJuly 15, 2015 at 4:44 pm #986840anywherefest
Participant#1 Thanks Nico for referring me to Brian’s thread. I am having no issue with recurring events but I would still like to try to order them alphabetically…I understand it is calling a masonry style but I’d like to try given I have set parameters re. excerpt text etc. Am I just missing something with regard to ‘tribe_change_event_order_list_view’?
#2 I would like to change the title in ‘list’ view only (or all event views) but not across the whole site…
Cheers
AlexJuly 17, 2015 at 1:47 pm #987490Nico
MemberHey Alex,
Thanks for the follow-up!
#1 – Nice, I just wanted you to be aware of masonry there and I thought Brian did a good job explaining it there. That said you can extend the snippet to include photo view as well – I also changed the function name but that’s not necessary:
add_filter( 'pre_get_posts', 'tribe_change_event_order', 99 );
function tribe_change_event_order( $query ) {
if ( tribe_is_past() || tribe_is_upcoming() || tribe_is_photo() ) {
$query->set( 'orderby', 'title' );
$query->set( 'order', 'ASC' );
}
return $query;
}
#2 – If you only need to change it for the list view, the template override approach is ok. Most probably the template override is not working at all. Please check that the override is in the correct path, it should be at ‘wp-content/[your_theme]/tribe-events/list/content.php’. If you are still not sure about this process, please check Themer’s Guide.
Please let me know if these tips helped you out,
Best,
NicoJuly 18, 2015 at 1:49 am #987537anywherefest
ParticipantNico, thanks so much for your reply, much appreciated. The A-Z snipper (#2) is perfect…but #1 is a mystery…I want to change the page title and the override path is definitely correct- theme/tribe-events/list/content.php but no dice. According to my source code it is calling an H1 heading…
July 20, 2015 at 4:17 am #987749Nico
MemberHi Alex,
Thanks for the follow-up, glad to hear that snippet worked for you!
Regarding the template override, if it’s in place you should be able to override that H1 with whatever title you want to show there. Can you share a link to the page where you want to change the title and show me which title is it? Maybe I’m getting you wrong. From what I see in the ‘original’ template the element holding the title is a H2 at line 21.
Do you see other changes in the template override working? Can you add a random string to the top of the template just to see if the override is working correctly?
I’m sure we are pretty close to solving this 🙂
Just let me know about those questions,
Best,
NicoAugust 4, 2015 at 7:05 am #993039Support Droid
KeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘SORT ALPHABETICALLY + CHANGE TITLE’ is closed to new replies.
