I tried to edit the file 'functions.php' on the browser, but now all I get is this message error: 'Parse error: syntax error, unexpected '}' in /home/julie/public_html/wp-content/themes/canape/functions.php on line 265'
Asked
Active
Viewed 968 times
0
-
can you show us the line 265 of your functions.php ? – Mouaici_Med Mar 03 '17 at 22:04
2 Answers
0
It looks like you are missing a character or something. Maybe if you show us some code, we can help you...
Leave out sensitive information.
If you are not able to get into the functions.php file via the browser anymore, you must get access to it via ftp.
Here is your error:
add_action( 'pre_get_posts', 'canape_menu_posts' );"
if ( ! is_tax( 'nova_menu' ) || ! is_a ( $query, 'WP_Query' ) || ! $query->is_main_query() ) { return; }
$query->set( 'posts_per_page', '999' );
$query->set( 'orderby', 'menu_order' );
$query->set( 'order', 'ASC' ); return;
}
add_action( 'pre_get_posts', 'canape_menu_posts' );
If you see the top right corner of the function, you will see that you are returning i a function body and then again under it.

Ulrik McArdle
- 601
- 4
- 9
-
I still have access to the file, but it seems that it does not make a difference if I change the code. Here's the code (line 265 is the one after "add_action( 'pre_get_posts', 'canape_menu_posts' );" if ( ! is_tax( 'nova_menu' ) || ! is_a ( $query, 'WP_Query' ) || ! $query->is_main_query() ) { return; } $query->set( 'posts_per_page', '999' ); $query->set( 'orderby', 'menu_order' ); $query->set( 'order', 'ASC' ); return; } add_action( 'pre_get_posts', 'canape_menu_posts' ); – Dereck Alexandre Mar 03 '17 at 22:12
-
Looks like after your return statement you have a curly brace } - remove that and see if that solved the problem... – Ulrik McArdle Mar 03 '17 at 22:18
-
0
In the very first line of the code snippet above, there's an unneeded " double quote after the semicolon.

Greg Burkett
- 1,905
- 1
- 12
- 14