Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [PHP]Problem Theme do Wordpress
Forum PHP.pl > Forum > Przedszkole
firioth
Witam serdecznie.

Ostatnio zakupiłem dosyć ciekawy Theme do wordpressa, jednak dopiero teraz miałem czas się z nim pobawić. Niestety zabawa rozpoczęła się na dosyć wczesnym etapie. Po wgraniu Theme na serwer i aktywowaniu go w panelu administratora od razu pojawił się błąd:

Cytat
Parse error: syntax error, unexpected '{' in /virtual/gamersden.cba.pl/wp-content/themes/gameaddict/themeOptions/functions.php on line 1


Na szczęście kod nie jest długi także pozwolę sobie go tutaj zacytować:

  1. <?php
  2. if ( !function_exists( 'optionsframework_init' ) ) {
  3. /*-----------------------------------------------------------------------------------*/
  4. /* Options Framework Theme
  5. /*-----------------------------------------------------------------------------------*/
  6. /* Set the file path based on whether the Options Framework Theme is a parent theme or child theme */
  7.  
  8. define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/themeOptions/admin/');
  9. define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/themeOptions/admin/');
  10.  
  11. require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
  12. }
  13. /*
  14.  * This is an example of how to add custom scripts to the options panel.
  15.  * This one shows/hides the an option when a checkbox is clicked.
  16.  */
  17. add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');
  18. function optionsframework_custom_scripts() { ?>
  19. <script type="text/javascript">
  20. jQuery(document).ready(function() {
  21. jQuery('#example_showhidden').click(function() {
  22. jQuery('#section-example_text_hidden').fadeToggle(400);
  23. });
  24. if (jQuery('#example_showhidden:checked').val() !== undefined) {
  25. jQuery('#section-example_text_hidden').show();
  26. }
  27. });
  28. </script>
  29. <?php
  30. }
  31. /*
  32.  * Turns off the default options panel from Twenty Eleven
  33.  */
  34. add_action('after_setup_theme','remove_twentyeleven_options', 100);
  35. function remove_twentyeleven_options() {
  36. remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );
  37. }
  38. ?>


Dziwi mnie trochę to że wywala błąd w 1 linijce, w której znajduje się tylko <?php.

Z góry dziękuje za pomoc i pozdrawiam.
nospor
Jestes pewien, ze pokazales nam plik functions.php ?
firioth
Tak to jest plik functions.php.

Jedyne co mi przyszło do głowy, to że gdy odpalę ten plik w notatniku (a nie notepad ++) to całość wygląda tak:

  1. <?phpif ( !function_exists( 'optionsframework_init' ) ) {/*-----------------------------------------------------------------------------------*//* Options Framework Theme/*-----------------------------------------------------------------------------------*//* Set the file path based on whether the Options Framework Theme is a parent theme or child theme */ define('OPTIONS_FRAMEWORK_URL', get_template_directory() . '/themeOptions/admin/'); define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/themeOptions/admin/');require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');}/* * This is an example of how to add custom scripts to the options panel. * This one shows/hides the an option when a checkbox is clicked. */add_action('optionsframework_custom_scripts', 'optionsframework_custom_scripts');function optionsframework_custom_scripts() { ?><script type="text/javascript">jQuery(document).ready(function() { jQuery('#example_showhidden').click(function() { jQuery('#section-example_text_hidden').fadeToggle(400); }); if (jQuery('#example_showhidden:checked').val() !== undefined) { jQuery('#section-example_text_hidden').show(); }});</script><?php}/* * Turns off the default options panel from Twenty Eleven */add_action('after_setup_theme','remove_twentyeleven_options', 100);function remove_twentyeleven_options() { remove_action( 'admin_menu', 'twentyeleven_theme_options_add_page' );}?>


I dla tego możliwe że strona czyta to jako błąd w 1 linijce.
nospor
miedzy <?php a IF musi byc conajmniej spacja
firioth
Poprawiałem już to, efekt był taki sam. Niestety to nie to
Pyton_000
Błąd zapewne jest w pliku który ładuje functions.php a nie nim samym.
firioth
A jest możliwość sprawdzenia, który to plik ?
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.