Jump to content

pixelwm

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pixelwm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. As I said I am a complete beginner on this so if that is all that is needed, then I will try it out and resubmit the theme to wordpress.org and see if it works for them. Thanks.
  2. Actually the script as you see is as it is. The only thing I left out was the top of it which was just comments only. The line mentioned in the error was the very last line of the file which was actually a blank line...nothing there. Plus when I posted the script here, just to make it shorter I removed some extra blank lines. So what you see is actually the full file (minus the comments part).
  3. First up, I forgot to mention my PHP knowledge is far before that of a beginner The code snippets I got above were from another source which completely had theirs all wrong and someone commented how to correct it which is what I used. Then I tried to do the if and else for the conditionals... So straight to the point, thanks for the reply, but I am still in the dark here and trying to figure out why the code works but they said it has a parsing error. I did find a site so if I read right, short tags is bad coding technique as some host servers don't support it and short tags are like or referring to '<?' when a full tag is '<?php'. So basically what I have above works but needs to be rewritten? If so, now I'm really stuck because again, I am no php guru.
  4. I hope I have the right forum here... but anyway, I am working on a wordpress theme and it uses some conditionals for header images based on whether a person is on a front page, page, post, or category so I came across separate snippets of php that do the above and when I put them together it works fine in my demo site but wordpress.org said they got an error: PHP Parse error: syntax error, unexpected $end in /usr/home/web/theme-test/public_html/wp-content/themes/evening-shade/advertise.php on line 40 The file in question is brought into the page with a typical includes: <?php include (TEMPLATEPATH . '/advertise.php'); ?> but the file itself is made up of the following code: <?php if (is_front_page()) { ?> <div id="advert1"></div> <?php } else { ?> <?php // Custom Headers for pages and posts with custom fields if (get_post_meta($post->ID, 'header', true)) { ?> <div id="advert1"><img src="<? bloginfo('url'); ?>/wp-content/uploads/<? echo get_post_meta($post->ID, 'header', true) ?>" alt="<?php the_title(); ?>" /></div> <? } else { ?> <?php /**** Conditional Header for Per Category Example Wordpress ****/ // make sure we are in category listing if (is_category()){ if (is_category('3')){ include(TEMPLATEPATH.'/headers/vineyardnews.php'); } elseif (is_category('5')){ include(TEMPLATEPATH.'/headers/experiences.php'); } else { // this is the deafult header include(TEMPLATEPATH.'/headers/default.php'); } } ?> <? } ?> <?php } ?> Even though this works live in a site, I am trying to figure out what is not correct. Does anyone have an idea of what is creating the error the guy got? Thanks in Advance.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.