Php Help on my blog.

by 6 replies
7
Hi warriors, I have a self hosted wordpress blog. But while I was pasting some add code to the theme, suddenly the blog could not just load. Each time I type the url to my web browser this is what is always displayed. Parse error: syntax error, unexpected '<' in /home/fataiade/public_html/wp-content/themes/magazine-basic/widgets/widget_feature.php on line 58. Please can some one come to my aid.

Thanks.

#programming #blog #php
  • Hi Vijay, there is error in widget_feature.php, there is unexpected "<" on line 58.
    Maybe you could check what you added there? Best way to check is download the file from your host and check it in dreamweaver.
  • pdrw07, thanks for your assistance, I have checked and Edith the said file. But there is no changes, though I use front page to check and Edith the file.

    Thanks.
    • [1] reply
    • Stick the code on here for us to have a look?
  • Yes Adi is right, paste the code here so we could look it.
  • Thanks you all for your concern. The following is the code you requested.

    <?phpfunction widget_sideFeature() { $options = get_option("widget_sideFeature"); $numberOf = $options['number']; $category = $options['category']; $category = "&cat=" . $category; $showposts = "showposts=" . $numberOf . $category ; ?> <?php $featuredPosts = new WP_Query(); $featuredPosts->query($showposts); ?> <?php $i = 1; ?> <?php while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?> <h1 class="side"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1> <div class="meta"> By <?php the_author() ?> </div> <div class="storycontent <?php if($numberOf == $i) { echo "noline"; } $i++; ?>"> <?php theme_excerpt('25'); ?> </div> <?php endwhile; }function widget_myFeature($args) { extract($args); $options = get_option("widget_sideFeature"); echo $before_widget; echo $before_title; echo $options['title']; echo $after_title; widget_sideFeature(); echo $after_widget; }function myFeature_control(){ $options = get_option("widget_sideFeature"); if (!is_array( $options )) { $options = array( 'title' => 'Feature', 'number' => '1', 'category' => '0' ); } if ($_POST['sideFeature-Submit']) { $options['title'] = htmlspecialchars($_POST['sideFeature-WidgetTitle']); $options['number'] = htmlspecialchars($_POST['sideFeature-PostNumber']); if ( $options['number'] > 5) { $options['number'] = 5; } $options['category'] = htmlspecialchars($_POST['sideFeature-Category']); update_option("widget_sideFeature", $options); }?> <p> <label for="sideFeature-WidgetTitle">Title: </label><br /> <input class="widefat" type="text" id="sideFeature-WidgetTitle" name="sideFeature-WidgetTitle" value="<?php echo $options['title'];?>" /> <br /><br /> <label for="sideFeature-PostNumber">Number of posts to show: </label> <input type="text" id="sideFeature-PostNumber" name="sideFeature-PostNumber" style="width: 25px; text-align: center;" maxlength="1" value="<?php echo $options['number'];?>" /><br /> <small><em>(max 5)</em></small> <br /><br /> <label for="sideFeature-Category">From which category: </label> <?php $options = get_option("widget_sideFeature"); $category = $options['category']; ?> <?php wp_dropdown_categories('name=sideFeature-Category&selected='.$category); ?> <input type="hidden" id="sideFeature-Submit" name="sideFeature-Submit" value="1" /> <p><small><em>(Note: The selected will be excluded from the main content on the index page)</em></small></p> </p><?php}register_sidebar_widget( 'Featured Post', 'widget_myFeature');register_widget_control( 'Featured Post', 'myFeature_control');?>
  • This the code for the widget - where is the code for the ad code you put in? I'm sure that you have either an extra '<' in the ad code or you inserted your ad code in the wrong place.

Next Topics on Trending Feed

  • 7

    Hi warriors, I have a self hosted wordpress blog. But while I was pasting some add code to the theme, suddenly the blog could not just load. Each time I type the url to my web browser this is what is always displayed. Parse error: syntax error, unexpected '<' in /home/fataiade/public_html/wp-content/themes/magazine-basic/widgets/widget_feature.php on line 58. Please can some one come to my aid. Thanks.