• Hello All,

    Good morning. After upgrading to the latest wp version I am getting this error on my news/blog page

    Notice: start_wp is deprecated since version 1.5! Use new WordPress Loop instead. in /home/ocdc.com/wp-includes/functions.php on line 3573

    I am using the following code there the above message is showing up

    [Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]

    <?php
                    $posts = get_posts('numberposts=3&order=DESC&orderby=post_date&category_name=news' );
                    foreach ( $posts as $post ) : start_wp();
    
                      echo "<div class='news_item'>";
    
                          toolbox_posted_on();
    
                              if ( has_post_thumbnail() ) {
                              the_post_thumbnail();
                              }
                     ?>
                         <div class="date"><i class="fa fa-calendar-o"></i> <?php the_time('M'); ?> <?php the_time('d'); ?> <?php the_time('Y'); ?></div>
                         <h4>
                           <a>" title="<?php the_title(); ?>">
                             <?php the_title() ; ?>
                           </a>
                         </h4>
                         <?php //$content = get_the_content(); echo wp_trim_words( $content , '30' ); ?>
                         <?php  the_excerpt() ;?>
    
    			     <?php
    				 echo "</div>";
    				 endforeach;
    				 ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • Geoffrey Shilling

    (@geoffreyshilling)

    Volunteer Moderator

    It looks like your site is running PHP version 5.2.13; WordPress recommends 5.6 or greater.

    Note: If you are in a legacy environment where you only have older PHP or MySQL versions, WordPress also works with PHP 5.2.4+ and MySQL 5.0+, but these versions have reached official End Of Life and as such may expose your site to security vulnerabilities.

    I recommend asking your host if you can get your PHP updated and then see if you are still receiving that message.

    @raws4581, the notice is pretty clear in this case: it’s telling you that the start_wp() function which you’re using in your code was deprecated (retired) many WordPress versions ago, and that you really should be using the Loop instead.

    (Also, you typically won’t even see developmental notices like this when WP_DEBUG is set to FALSE in your wp-config.php file, unless your server’s PHP configuration setting for error reporting is overriding that value.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error Message’ is closed to new replies.