Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Problem Theme do Wordpress
firioth
post 13.11.2014, 11:10:07
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 13.11.2014

Ostrzeżenie: (0%)
-----


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.
Go to the top of the page
+Quote Post
nospor
post 13.11.2014, 11:14:26
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Jestes pewien, ze pokazales nam plik functions.php ?


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
firioth
post 13.11.2014, 11:17:44
Post #3





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 13.11.2014

Ostrzeżenie: (0%)
-----


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.
Go to the top of the page
+Quote Post
nospor
post 13.11.2014, 11:24:04
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




miedzy <?php a IF musi byc conajmniej spacja


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
firioth
post 13.11.2014, 11:32:19
Post #5





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 13.11.2014

Ostrzeżenie: (0%)
-----


Poprawiałem już to, efekt był taki sam. Niestety to nie to

Ten post edytował firioth 13.11.2014, 12:07:00
Go to the top of the page
+Quote Post
Pyton_000
post 13.11.2014, 12:16:34
Post #6





Grupa: Zarejestrowani
Postów: 8 068
Pomógł: 1414
Dołączył: 26.10.2005

Ostrzeżenie: (0%)
-----


Błąd zapewne jest w pliku który ładuje functions.php a nie nim samym.
Go to the top of the page
+Quote Post
firioth
post 13.11.2014, 12:25:34
Post #7





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 13.11.2014

Ostrzeżenie: (0%)
-----


A jest możliwość sprawdzenia, który to plik ?
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 22.06.2025 - 12:54