Home › Forums › Calendar Products › Events Calendar PRO › error message for the slug
- This topic has 5 replies, 3 voices, and was last updated 10 years, 3 months ago by
George.
-
AuthorPosts
-
December 15, 2015 at 1:49 pm #1041888
Birgit Bauer
ParticipantHello,
i wonder why I get an error message for my slug. I changed the slug for the event. And I wanted to but I get this error: http://screencast.com/t/TL1a5wludQ
How can I get rid of this message … since I don’t want to use the default URL ‘events’ ?
December 16, 2015 at 11:31 am #1042420Nico
MemberHi there Birgit,
Thanks for reaching out on this! I’ll try to clarify on this.
You are seeing the message because there’s a page with the same slug as the calendar slug. There’s nothing wrong with that, but as the messages states, the calendar will be shown instead of the page with the same slug. Some users do this intentionally to have a menu item or something similar. If you want to remove the message just add the following snippet to your theme functions.php file (wp-content/themes/active_theme/functions.php):
// remove slug conflict admin notice
if (class_exists('Tribe__Events__Admin__Notice__Archive_Slug_Conflict')) {
remove_action( 'admin_init', array( Tribe__Events__Admin__Notice__Archive_Slug_Conflict::instance(), 'maybe_add_admin_notice' ) );
}
Please give that a try and let me know,
Best,
NicoJanuary 8, 2016 at 8:49 am #1052646Birgit Bauer
ParticipantHello, finally I got to that point. I used the code but for any reason the message is still there.
Here is what I did:
I took the functions.php of my child theme and added the code like this:
<?php // // Recommended way to include parent theme styles. // (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme) // add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' ); function theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') ); } // // Your code goes below // // remove slug conflict admin notice if (class_exists('Tribe__Events__Admin__Notice__Archive_Slug_Conflict')) { remove_action( 'admin_init', array( Tribe__Events__Admin__Notice__Archive_Slug_Conflict::instance(), 'maybe_add_admin_notice' ) ); }Is there any mistake?
January 12, 2016 at 9:13 pm #1054967George
ParticipantHey there,
Apologies for the delayed reply, Nico’s been out-of-office for a bit so I wanted to chime in here to keep things moving!
I do not spot an error in your code; however, its placement in your child theme’s functions.php file might be relevant to the lack of functionality. If you place it in the PARENT theme’s functions.php file does anything improve? I doubt this will help but am curious.
—
A bigger point here is that you should not have a page that has the /events/ slug – hence the display of that error message. So an even better solution than the custom code would be one of these options:
1. Delete the page whose slug is /events, or just change its slug at least.
2. Change the “Events slug” option for your events calendar so that is not also trying to exist at /events – you can change it to /calendar, /agenda, anything at all. Check out Events > Settings in your site’s wp-admin to see the options for changing slugs.
Either option here may help and is recommended much more than the code change is.
I hope this information helps!
Sincerely,
GeorgeJanuary 18, 2016 at 10:59 am #1057995Birgit Bauer
ParticipantHi George, I just deleted the page .. was the simplest way for me …
Thank you!
January 18, 2016 at 11:24 am #1058010George
ParticipantGlad to hear it! 😀
Thanks for the update here – best of luck with your site.
– George
-
AuthorPosts
- The topic ‘error message for the slug’ is closed to new replies.
