Home › Forums › Calendar Products › Events Calendar PRO › I pasted a code you gave me, my site is not working
- This topic has 19 replies, 3 voices, and was last updated 9 years, 5 months ago by
BRUNO HERMES.
-
AuthorPosts
-
October 25, 2016 at 2:08 am #1182341
BRUNO HERMES
ParticipantHello,
In other ticket, I talked with Brook.
I said him I wanted to change the word Events to another one.
OK, he gave this link https://theeventscalendar.com/knowledgebase/changing-the-word-events-to-something-else/
I copied that code to the functon php. And as soon as I did that. My site was off. this was the error:
Parse error: syntax error, unexpected ‘;’ in /home/brunohm/public_html/wp-content/themes/Newspaper/functions.php on line 166
This is not the first time this happens. So I had to contact the support of my hosting, because I couldn’t also enter to my wp-admin page. The plugin did a conflict with the theme. We deleted the plugins Event Calendar and the PRO, and nothing.
Then I changed the theme, and the page started to work, but you know, horrible. The error was so big, we couldn’t find the function.php file in the CPanel. We ended up also deleting both plugin files from there.
Then I activated the theme again, and I found the fuction.php file and I deleted the code. But the problem it’s still there.
And all for that code 🙁
I need my site working well, and I spected the plugin also.
I need your help becaause this plugin is causing me a lot of problems.
Thank you
Best regards
October 25, 2016 at 7:15 pm #1182926Nico
MemberHi Bruno,
Thanks for getting in touch with us once again and really sorry to hear about this issue in your site 🙁
Most probably this issue was caused because the code was copied including the php opening tag (<?php) or maybe it was another similar formatting issue. The code itself doesn’t seem to be causing the error (unless the description is not indicating this).
Then I changed the theme, and the page started to work, but you know, horrible. The error was so big, we couldn’t find the function.php file in the CPanel. We ended up also deleting both plugin files from there. Then I activated the theme again, and I found the fuction.php file and I deleted the code. But the problem it’s still there.
I’m aware the article doesn’t mention this but it’s a WordPress good practice to not edit the theme files directly (unless it’s a theme you crafted) but use a child theme instead. Also, please note that to restore the site you just need to remove the code from the theme which can be tricky if you are doing this from the WordPress Admin (because the error will prevent the page from loading), but editing the file to remove the snippet with an FTP client or via cPanel file manager should be the way to go. As the snippet lives in the theme’s (or child theme’s) functions.php file removing the plugins won’t fix this as you noticed 🙁
I need my site working well, and I spected the plugin also. I need your help becaause this plugin is causing me a lot of problems.
So from what you describe the site is working well right now that the snippet has been removed right? If that’s the case please share the content of your functions.php (you can do so with a Gist, PasteBin or any other code sharing service) and I can send you over the file contents with the snippet in. Hopefully this will activate the snippet without generating errors to the site!
Please let me know about it,
Best,
NicoPS: I noticed the site is in Spanish, if you want to continue the conversation is that language just reply en Español 😉
October 25, 2016 at 11:40 pm #1183044BRUNO HERMES
ParticipantThis reply is private.
October 26, 2016 at 7:24 am #1183155Nico
MemberThis reply is private.
October 27, 2016 at 12:56 am #1183609BRUNO HERMES
ParticipantThis reply is private.
October 31, 2016 at 10:57 am #1185363BRUNO HERMES
ParticipantHello, Hola…
Sigue funcionando este ticket?
October 31, 2016 at 10:25 pm #1185622Nico
MemberBruno, como estas?
Disculpa la demora, no trabajamos los fines de semana y eso hace que los lunes sean un poco mas pesados!
Con respecto a tus consultas:
Primero que nada, el aviso esta en ingles, la gente de mi sitio no entenderia nada.
Al parecer eso se debe a la falta de traducción para esa cadena específicamente. En caso de que no estés usando la ultima versión por favor actualiza (esto debería incluir las ultimas traducciones. Que idioma estas usando en el sitio? Español simplemente o Español de algún país en particular?
Luego, como ves, dice lo que dice… El problema es el siguiente… Los eventos en mi sitio esta la gente busca eventos constantemente, y no solo del actual mes, si no de anteriores, o proximos. Yo quiero que cuando alguien busque por nombre, que la busqueda sea basada en el titulo del evento, y que aunque estemos en octubre, la busqueda muestre el evento de otro mes.
Para este tipo de búsqueda debes usar la búsqueda por defecto de WordPress y no el campo de búsqueda del calendario que buscara siempre eventos en la vista actual. En el caso que muestras solo busca para Octubre 2016.
Despues, estaba pensado en cambiar los eventos para que se muestren como lista. Pero despues de la foto del evento, se muestra mucho texto antes del leer mas. Prefiero que sea mas corto, tuve que poner zoom al 60% para poder verlo asi.
El texto que se muestra en esa vista es el ‘extracto’ o ‘excerpt’ en inglés. Revisa este articulo donde se explica como ajustarlo → The Trouble with Excerpts.
Tambien pensaba si podia agregarle aqui… http://screencast.com/t/KodJcslPP … un search form, tal cual tengo en otras paginas del sitio, que pongo con el shortcode wp-search
Podrías indicarme cual es el shortocode que estas usando? Es propio del theme? Viene incluido en algún plugin? Tal vez sea posible insertarlo ahi.
Saludos,
NicoNovember 2, 2016 at 2:30 pm #1186584BRUNO HERMES
ParticipantThis reply is private.
November 2, 2016 at 2:38 pm #1186590BRUNO HERMES
ParticipantThis reply is private.
November 3, 2016 at 3:42 pm #1187420BRUNO HERMES
ParticipantLa gente del tema me dio un nuevo shortcode que tambien funciona: `[vc_wp_search]
Espero tu respuesta.
Saludos 🙂
November 4, 2016 at 2:55 pm #1187960Nico
MemberGracias por la respuesta! Me alegro que pudieron solucionar el problema con el shortcode de búsqueda 🙂
Pude verificar el problema con la traducción que mencionas. Al parecer fue un problema que tuvimos al empaquetar los archivos de traducción para el lanzamiento de la nueva versión. Es algo que estamos viendo de solucionar lo antes posible!
Mientras tanto puede agregar este código al archivo functions.php de th theme o child theme:
/* Tribe, custom translation */
function tribe_custom_theme_text ( $translation, $text, $domain ) {$custom_text = array(
'There were no results found for %s.' => 'No se encontraron resultados para %s.',
);// If this text domain starts with "tribe-", "the-events-", or "event-" and we have replacement text
if( (strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0 || strpos($domain, 'event-') === 0) && array_key_exists($translation, $custom_text) ) {
$translation = $custom_text[$translation];
}
return $translation;
}
add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
De la misma manera puede agregar mas cadenas que no aparezcan traducidas (en este articulo se explica como).
Si no genera un gran inconveniente en tu sitio diría que lo mejor es esperar a que el próximo update lo solucione (el plan es lanzarlo en dos semanas aproximadamente).
Saludos, buen fin de semana,
NicoNovember 9, 2016 at 4:10 am #1189536BRUNO HERMES
ParticipantHola Nico,
Mejor espero la actualización del plugin.
Te hago una pregunta, ese shortcode de busqueda, yo lo quiero poner acá
http://www.screencast.com/t/KodJcslPPComo sería posible insertarlo?
November 9, 2016 at 11:16 am #1189844Nico
MemberExcelente!
Podes aprovechar algunas de las acciones presentes en el template de ‘list view’ e insertarlo desde código sin necesidad de editar los templates. Agrega el siguiente código al archivo functions.php de tu theme (o child theme):
/* Tribe, echo shortcode before events */
function tribe_add_shortcode_before_events ( ) {// bail if not in list view
if ( !tribe_is_list_view() ) return;// insert output of the shortcode
echo do_shortcode( '[vc_wp_search]' );}
add_action( 'tribe_events_after_header', 'tribe_add_shortcode_before_events' );
Básicamente el script checkea si estas en ‘list view’ y en ese caso imprime el shortcode.
Avisame si funciona correctamente en tu sitio,
Saludos,
NicoNovember 12, 2016 at 4:17 am #1191297BRUNO HERMES
ParticipantGenial, funciona perfecto!
2 consultas mas, Prefiero que los eventos no tengan ningun excerpt… Que codigo necesito?
Otra duda, como hago para que los usuarios vean el evento con su zona horaria. El evento dura todo el dia…
Muchas gracias 🙂
November 15, 2016 at 6:31 am #1192377Nico
MemberBuenisimo Bruno!
Prefiero que los eventos no tengan ningun excerpt… Que codigo necesito?
En que vista(s) necesitas ocultar el exceprt? Seguramente lo mas sencillo sea hacerlo con un snippet de CSS. Detallame en que vistas necesitas hacerlo y te paso el código.
Otra duda, como hago para que los usuarios vean el evento con su zona horaria. El evento dura todo el dia…
La zona horaria se puede definir por evento o los eventos pueden seguir la configuración global del sitio pero no hay ninguna opción para que cada usuario pueda verlos en su zona horaria lamentablemente. Podes elegir mostrar la zona horaria del evento junto a la fecha / hora si eso sirve de ayuda (WP-Admin > Events > Settings > Display > Show timezone).
Saludos,
Nico -
AuthorPosts
- The topic ‘I pasted a code you gave me, my site is not working’ is closed to new replies.
