![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: Aug 2008
Posts: 39
Thanks: 1
Thanked 1 Time in 1 Post
|
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. |
| Last edited by vijay08; 06-30-2009 at 02:32 PM. Reason: Mistake on the title. | |
| | |
| | #2 |
| HyperActive Warrior War Room Member Join Date: Jun 2008 Location: Jakarta
Posts: 279
Blog Entries: 1 Thanks: 50
Thanked 62 Times in 29 Posts
|
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. |
| | |
| | |
| | #3 |
| Active Warrior Join Date: Aug 2008
Posts: 39
Thanks: 1
Thanked 1 Time in 1 Post
|
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. |
| | |
| | #4 |
| Active Warrior Join Date: Apr 2009
Posts: 36
Thanks: 0
Thanked 2 Times in 2 Posts
|
Stick the code on here for us to have a look?
|
| | |
| | #6 |
| Active Warrior Join Date: Aug 2008
Posts: 39
Thanks: 1
Thanked 1 Time in 1 Post
|
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');?> |
| | |
| | #7 |
| Warrior Member Join Date: Jul 2009 Location: Central NJ
Posts: 12
Thanks: 0
Thanked 2 Times in 1 Post
|
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.
|
| | |
![]() |
|
| Tags |
| blog, php |
| Thread Tools | |
| |
![]() |