Forum Replies Created
-
AuthorPosts
-
AlexParticipant
Hi Victor
Yes I am aware this is a problem with the theme, my question is – how do I change The Events Calendar plugin so that it will not add in the /page/2/ part of the url when I refresh the page.
I have switched to a different theme and also disabled all plugins and I still see the /page/2/ portion of the URL get inserted when I refresh or go back a page. All I want to do is to stop your plugin from adding that bit into the url.
Thanks,
AlexAlexParticipantHi Victor
Thanks for getting back to me. I’ve just updated all plugins to the latest versions and I’m still getting the error.
I’ve checked the box to say I want to share my support info with you.
I’ve checked my permalinks and we are using a custom structure of %category%/%postname%
I’ve used the plugin on a fresh page and it works fine, it just seems to be my current setup that it doesn’t want to work on. Any help would be greatly appreciated!
Thanks
AlexAlexParticipantHey Shelby
Completely understand that you can’t support this specifically, however – would you be able to tell me where I should be looking to remove the function that drops in the /page/2/ as I feel that once I remove that – I’ll be able to solve my problem! Otherwise, I feel like I may need to write some kind of function that looks for ‘/events/page/REGEX/’, takes the whole url, strips out that section and then redirects to the new one… which may not even work…
AlexParticipantHey Shelby
No problem! So yes, the theme I’m using is this one – http://edition.themewich.com/
It’s put together in a set of ‘sections’ which are controlled from one navigation option in the sidebar and each of the pages in the theme is controlled through the post categories section under the posts part of the wordpress admin nav (I can create a login for you to see this for yourself if it would make explaining it slightly easier?)
In one of these sections, I’ve included the shortcode and put a few different sections together on the page to make the one you currently see – so there’s not really a posibility for me to send the page template over as it’s made up from a few different of these sections.
Thanks
AlexAlexParticipantHey Shelby & Team!
So this issue has come back and slipped through the cracks into live so I’m under quite a lot of pressure to get it fixed PDQ!
So I’ve done a bit more digging and I’ve narrowed the problem down to this, when a user refreshes the page or navigates back a page, they are redirected from:
http://www.visitcardiff.com/events/?tribe_paged=2&tribe_event_display=list
To
http://www.visitcardiff.com/events/page/2/?tribe_paged=2&tribe_event_display=list
Notice the addition of the /page/2/ in the url. Now I’ve turned off all of the other plugins and switched theme, and this still happens so I’m assuming it’s part of The Events Calendar. It’s also worth noting, I’m not using the events calendar ‘page’ but instead using the [tribe_events view=”list”] shortcode to display the page (because of the way the theme I’m using is put together, it has to be done this way). The pages are made up from post categories and each section included on the page has to be created seperately.
So, when I include this shortcode on a page, it works fine. When I use the proper calendar, it works fine. It just doesn’t seem to work when I use it as part of this shortcode on this type of page. I am presuming, there is something baked into the events calendar plugin which is forcing the redirect and adding that /page/2/ in the middle of the URL – but I can’t find it. So I guess any help to remove that function would be greatly appreciated as it seems to serve no real purpose as the pagination is determined from the query string, rather than the domain.
Thanks
AlexAlexParticipantHey Shelby
Thanks for getting back to me – but the problem seems to have resolved itself – I have no idea how. If it returns, I’ll do some digging and try to find what happened and let you know!
AlexParticipantI am also seeing this problem at the moment (but in the Welsh language) if this offers any more help towards getting a resolution for this bug.
**Edit**
I’ve found a (very) hacky way to get this working while a fix is being developed.
In the-events-calendar/src/views/modules/bar.php at line 45, there is a select with a for loop below.
I have modified it to look like the following
`
<?php
$url = ‘http://’ . $_SERVER[‘SERVER_NAME’] . $_SERVER[‘REQUEST_URI’];
if ( strpos( $url, ‘/cy/’ ) !== false ) {
echo ‘
<option tribe-inactive=”” value=”[YOUR-SITE-URL]/cy/events/list/” data-view=”list”>
Rhestr</option>
<option tribe-inactive=”” value=”[YOUR-SITE-URL]/cy/events/month/” data-view=”month”>
Mis</option>
<option tribe-inactive=”” value=”[YOUR-SITE-URL]/cy/events/week/” data-view=”week”>
Week</option>
<option tribe-inactive=”” value=”[YOUR-SITE-URL]/cy/events/day/” data-view=”day”>
Diwrnod</option>
<option tribe-inactive=”” value=”[YOUR-SITE-URL]/cy/events/map/” data-view=”map”>
Map </option>’;
} else {
foreach ( $views as $view ) : ?>
<option <?php echo tribe_is_view( $view[‘displaying’] ) ? ‘selected’ : ‘tribe – inactive’ ?>
value=”<?php echo esc_attr( $view[‘url’] ); ?>”
data-view=”<?php echo esc_attr( $view[‘displaying’] ); ?>”>
<?php echo $view[‘anchor’]; ?>
</option>
<?php endforeach;
}
?>
`
Where the ‘/cy/’ being searched for is the language being added by WPML. It will never change the tribe-inactive to select, but if you need something a bit quick and dirty to get things live (as I do!) then this will work.
- This reply was modified 6 years, 11 months ago by Alex. Reason: Added potential solution
May 2, 2017 at 4:06 am in reply to: Custom String Changes using tribe_custom_theme_text function #1277152AlexParticipantHi Trisha
Thanks for getting back to me, my problem is a little complicated…
I can’t use a traditional language switcher plugin as only the events section of my website needs translating – there are no translations available for the rest of the site and all traditional plugins seem to force their translations site wide.
Thank you for the links to the information on the .po files though – I feel like I’m heading in the right direction with these. I’ve installed a plugin called Loco Translate which looks like it’ll be able to update a .po file for me, which is great, but if you could provide any information on how to allow a visitor to the site to switch .po / .mo file that would solve my problem!
Thanks,
AlexApril 29, 2017 at 4:19 am in reply to: Custom String Changes using tribe_custom_theme_text function #1276218AlexParticipantHi Trisha
Thanks for sending me the link to that file – there are quite a few translations after all!
The function I’ve got however dosn’t seem to be working with the translations correctly though.
/This is the function to accommodate the welsh / English differences within the MT plugin. function glue_tran( $en, $cy ) { if ( $_SESSION['lang'] == 'en' ) { return $en; } else { return $cy; } } function tribe_custom_theme_text( $translation, $text, $domain ) { // Put your custom text here in a key => value pair // Example: 'Text you want to change' => 'This is what it will be changed to' // The text you want to change is the key, and it is case-sensitive // The text you want to change it to is the value // You can freely add or remove key => values, but make sure to separate them with a comma // This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events" $custom_text = array( 'Upcoming %s' => glue_tran('Upcoming %s', 'Upcoming Welsh %s'), 'Related %s' => glue_tran('Related %s', 'Related Events Welsh'), 'Find out more' => glue_tran('Find out more', 'Welsh Find Out More'), 'Previous %s' => glue_tran('Previous Events', 'Welsh Previous Events'), 'Next %s' => glue_tran('Next Events', 'Welsh Next Events'), 'Past %s' => glue_tran('Past Events', 'Welsh Past Events'), '%s From' => glue_tran('Events From', 'Welsh Events From'), 'Search' => glue_tran('Search', 'Welsh Search'), 'Near' => glue_tran('Eng Near', 'Welsh Near'),//todo this one doesn't work 'Find %s' => glue_tran('Find Events', 'Welsh Find Events'), 'View As' => glue_tran('View As', 'Welsh View As'), 'List' => glue_tran('List', 'Welsh List'), 'Week' => glue_tran('Week', 'Welsh Week'),//todo this one doesn't work 'Month' => glue_tran('Month', 'Welsh Month'), 'Day' => glue_tran('Day', 'Welsh Day'), 'Map' => glue_tran('Map', 'Welsh Map'), //todo this one doesn't work 'April' => glue_tran('April', 'Welsh April'), //todo this one doesn't work 'Narrow Your Results' => glue_tran('Narrow Your Results', 'Welsh') //todo this one doesn't work ); // If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text if ( ( strpos( $domain, 'vc-events' ) === 0 || strpos( $domain, 'the-events-' ) === 0 || strpos( $domain, 'event-' ) === 0 ) && array_key_exists( $translation, $custom_text ) ) { $translation = $custom_text[ $translation ]; } return $translation; } //Add the tribe_custom_theme_text function as a filter add_filter( 'gettext', 'tribe_custom_theme_text', 1, 3 );
See all of the strings I’ve added with
//todo this one doesn't work
next to them – all of the others appear as they should in the website. I’ve only just gotten started with this (hence having no actual Welsh content in there yet) but if you could point me in the direction of where I’m going wrong that would be great.Cheers,
AlexApril 28, 2017 at 1:39 am in reply to: The Events Calendar PRO & WPML permalink always ?preview=true #1275679AlexParticipantHi Geoff
I’m in the UK so our timezones are well out for good morning / evening!
I suspected as much – it might be worthwhile putting the minimum support requirements on the post which explains integrating WPML with The Events Calendar – just incase someone else comes along and find’s themselves in a similar position.
Thanks for all your help with the issue though – I’ll start a new thread now with some other questions!
Cheers,
AlexApril 27, 2017 at 10:52 am in reply to: The Events Calendar PRO & WPML permalink always ?preview=true #1275356AlexParticipantHi Geoff
Thanks for getting back to me – I don’t have a staging copy of the site I’m sorry (well, this actually is the staging domain – but I’m a little hesitant to try doing anything with the WPML plugin now as I’ve spent most of the day adding conditional statements around various parts of various Modern Tribe plugins!)
I can send you a copy of the WPML plugin I am using though? So you could try installing it on a site at your end?
Thanks
AlexApril 26, 2017 at 2:29 pm in reply to: The Events Calendar PRO & WPML permalink always ?preview=true #1274963AlexParticipantHey Geoff
Thanks for getting back to me, I’ve actually had to go a different route with this now so I turned off the WPML plugin and built something of my own (using an ACF fields and some conditional statements within the single-event.php file).
I hadn’t clicked on the preview post button – it was the permalink that would appear as I started typing the main body of the post and remained there after I clicked publish (it would only happen on Event pages though – never on the main post pages)
April 26, 2017 at 7:35 am in reply to: The Events Calendar PRO & WPML permalink always ?preview=true #1274663AlexParticipantI could really do with any guidance or assistance with this if possible please, I need to know if it’s a problem with The Events Calendar, WPML or the combination of the two.
-
AuthorPosts