Parse error: syntax error, I can't fix the thing
-
** Please don’t close my topic. It happened once because I didn’t posted in the Omega forum but It’s not about Omega. It’s about that piece of code I use wrong and the theme name, you may change it to Marcus or anything else if you want.**
I have that piece of code that outputs my featured images:
if ( is_home() || is_archive() || is_search() ) { if(omega_get_setting( 'content_archive_thumbnail' )) { get_the_image( array( 'meta_key' => 'Thumbnail', 'default_size' => omega_get_setting( 'image_size' ) ) ); } }
I want to make use of jquery to mix it with:
if ( $(window).width() > 480) { //Add your javascript for large screens here } else { //Add your javascript for small screens here }
to have another featured image size for screens of 480px( the one I chosed in theme setings is wp-thumbnail and I made it 150×150 and for 480 screens I want wp-medium and make it 480px wide). But, when I put them together like this:
if ( is_home() || is_archive() || is_search() ) { if(omega_get_setting( 'content_archive_thumbnail' )) { get_the_image( array( 'meta_key' => 'Thumbnail', 'default_size' => omega_get_setting( 'image_size' ) ) ); } else { if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail(); } } }
I’m doing it wrong because I get Parse error: syntax error, unexpected ‘(‘, expecting T_VARIABLE or ‘$’ on this line if ($(window).width() < 480){
I know, it’s a shame I can’t fix it myself but if someone could give a little help? Thanks.
- The topic ‘Parse error: syntax error, I can't fix the thing’ is closed to new replies.