Title: Notice: Undefined variable: display   formatting errors
Last modified: August 30, 2016

---

# Notice: Undefined variable: display formatting errors

 *  Resolved [megseoh](https://wordpress.org/support/users/megseoh/)
 * (@megseoh)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/)
 * Since updating to networks latest posts version 3.7 I’m getting this error message“
   Notice: Undefined variable: display in mysite.ca/wp-content/plugins/network-latest-
   posts/network-latest-posts.php on line 290” & the formatting is completely off.
   9 posts are displaying all wonky instead of the 3 we had displaying previously.
   I updated to WordPress 4.2.2 at the same time. Any idea how to fix these issues?
 * I tried adding $display = ”; to line 199 of network-latest-posts.php but it didn’t
   help.
 * (This is occurring on our development site where I update the plugins first to
   ensure everything works before updating on the main site. It’s in Maintenance
   Mode & is not viewable to anyone who’s not logged in unfortunately. What it’s
   supposed to look like is down towards the middle-bottom < NEWS > section of this
   page [http://www.engineering.utoronto.ca/](http://www.engineering.utoronto.ca/))
 * Here is the code I’m using to display the latest posts:
 * ‘<div class=”row” style=”margin-top:20px;”>
    <div class=”col-md-12″> <div id=”
   news-carousel” class=”carousel slide”> <?php echo do_shortcode(‘[nlposts blog_id
   =”17,18″ number_posts=”9″ display_type=”block” sort_by_date=true thumbnail=true
   thumbnail_wh=”600×315″ use_pub_date=true full_meta=true]’); ?> </div> </div> 
   </div> <div class=”row” style=”margin-top:30px;”> <div class=”col-md-12 news-
   title”> [<i class=”fa fa-chevron-left fa-carousel”><span class=”sr-only”>Events Pervious</span></i>](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/?output_format=md#)
   [THIS WEEK’S EVENTS](https://wordpress.org/news-events/engineering-events/?output_format=md)
   [<i class=”fa fa-chevron-right fa-carousel”><span class=”sr-only”>Events Next</span></i>](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/?output_format=md#)
   </div> </div> <?php //Custom Post-Type Events //Today Date – YYYYMMDD $todayDate
   = date(“Ymd”); $args = array( ‘posts_per_page’ => -1, ‘offset’ => 0, ‘category’
   => ”, ‘orderby’ => ‘FASE_event_date’, ‘order’ => ‘ASC’, ‘include’ => ”, ‘exclude’
   => ”, ‘meta_key’ => ‘FASE_event_date’, ‘meta_value’ => $todayDate, ‘meta_compare’
   => ‘>=’, ‘post_type’ => ‘events’, ‘post_mime_type’ => ”, ‘post_parent’ => ”, ‘
   post_status’ => ‘publish’, ‘suppress_filters’ => true ); $allEvents = get_posts(
   $args); ?> <div class=”row”> <div class=”col-md-12″> <div id=”events-carousel”
   class=”carousel slide”> <?php $count = 0; foreach ($allEvents as $key => $data){
   $eventDate = get_post_meta($data->ID, ‘FASE_event_date’, true); $count++; ?> 
   <?php if ($count == 1) { ?> <div class=”row rowContainer”> <?php } ?> <div class
   =”col-xs-12 col-sm-6 col-xs-12 event-item” data-date=”<?php echo $eventDate; ?
   >”> <div class=”pull-left event-calendar”> ID); ?>”> <span class=”fa-stack fa-
   2x”> <i class=”fa fa-square fa-stack-2x teal”></i> <i class=”fa fa-calendar fa-
   stack-1x fa-inverse”></i> </span> <span class=”sr-only”>View more <?php echo 
   $data->post_title; ?></span>  </div> ID); ?>”> <div class=”event-text”> <span
   ><?php echo date(“F j, Y”, strtotime($eventDate)); ?></span> <p><?php echo $data-
   >post_title; ?></p> </div>  </div> <?php if (($count == 4) || ($key + 1 == count(
   $allEvents))) { $count = 0; ?> </div> <?php } ?> <?php } ?> </div> </div> </div
   > </div>’
 * Many thanks!
 * [https://wordpress.org/plugins/network-latest-posts/](https://wordpress.org/plugins/network-latest-posts/)

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238067)
 * Hi, @magseoh I do not know if your website is in production mode, but I still
   recommend you to avoid keeping `define('WP_DEBUG', true);` because these warnings
   contain information regarding your hosting paths.
 * However, this issue was related to a variable being used without it being previously
   declared. I have pushed into public repository version 3.7.1 which hopefully 
   fixes this.
 * Please let me know if it works for you.
 * Best regards,
    Jose SAYAGO.
 *  Thread Starter [megseoh](https://wordpress.org/support/users/megseoh/)
 * (@megseoh)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238163)
 * Hi Jose,
 * Thanks for the quick reply. The update got rid of the error message but the layout
   is still broken – do you have any idea why this might have happened?
 * It used to look like this: [http://grab.by/I8Ni](http://grab.by/I8Ni)
    But now
   it looks like this: [http://grab.by/I8Ns](http://grab.by/I8Ns)
 * The bootstrap classes & other formatting are no longer being applied.
    Thanks
   again 🙂
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238165)
 * Hello [@megseoh](https://wordpress.org/support/users/megseoh/),
 * I just checked your site and it looks like the first screenshot you attached:
   [Screenshot](http://i.imgur.com/p5hVgEz.png)
 * Maybe you’re seeing some locally cached version of your website?
 * Try cleaning your browser’s cache and check again.
 * Please let me know if it works.
 * Best regards,
    Jose SAYAGO
 *  Thread Starter [megseoh](https://wordpress.org/support/users/megseoh/)
 * (@megseoh)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238170)
 * Hey Jose,
 * The link that you checked is our live site which hasn’t been updated yet. I update
   WordPress & all plugins first on a development site to ensure that everything
   still works before updating on the live site. & the development site is in Maintenance
   Mode & is unfortunately not viewable by anyone who’s not logged in. That’s why
   I posted the screenshots instead of just links.
 * Any ideas what the problem might be?
 * Thanks 🙂
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238173)
 * Oh I get it, in the live site I see a custom HTML structure for posts. Have you
   or someone in your team created a custom HTML output for Network Latest Posts?
 *     ```
       <div class="row rowContainer">
       	<div class="col-md-4 col-sm-4 col-xs-12 newsItem nlposts-siteid-xx">
       		<a href="">
       			<img width="472" height="315" src="" class=" wp-post-image" alt="" title="">
       		</a>
       		<h3 class="news-article-title">
       			<a href="">
       				Post Title
       			</a>
       		</h3>
       		<div class="news-article-date">Date</div>
       	</div>
       </div>
       ```
   
 * If so, once the plugin was updated, all custom HTML structures were erased.
 * Please check your live’s website Network Latest Posts version, look for the function
   below:
 *     ```
       function nlp_display_type($display_type, $instance, $wrapper_list_css, $wrapper_block_css) {
           // Instances
           if( !empty($instance) ) { $nlp_instance = "nlp-instance-$instance"; }
           // Display Types
           switch($display_type) {
               // Unordered list
               case "ulist":
                       $html_tags = array(
                           'wrapper_o' => "<ul class='nlposts-wrapper nlposts-ulist $wrapper_list_css'>",
                           'wrapper_c' => "</ul>",
                           'wtitle_o' => "<h2 class='nlposts-ulist-wtitle'>",
                           'wtitle_c' => "</h2>",
                           'item_o' => "<li class='nlposts-ulist-litem'>",
                           'item_c' => "</li>",
                           'content_o' => "<div class='nlposts-container nlposts-ulist-container $nlp_instance'>",
                           'content_c' => "</div>",
                           'meta_o' => "<span class='nlposts-ulist-meta'>",
                           'meta_c' => "</span>",
                           'thumbnail_o' => "<ul class='nlposts-ulist-thumbnail thumbnails'>",
                           'thumbnail_c' => "</ul>",
                           'thumbnail_io' => "<li class='nlposts-ulist-thumbnail-litem span3'><div class='thumbnail'>",
                           'thumbnail_ic' => "</div></li>",
                           'pagination_o' => "<div class='nlposts-ulist-pagination pagination'>",
                           'pagination_c' => "</div>",
                           'title_o' => "<h3 class='nlposts-ulist-title'>",
                           'title_c' => "</h3>",
                           'excerpt_o' => "<ul class='nlposts-ulist-excerpt'><li>",
                           'excerpt_c' => "</li></ul>",
                           'caption_o' => "<div class='nlposts-caption'>",
                           'caption_c' => "</div>"
                       );
                       $html_tags = apply_filters( 'nlposts_ulist_output', $html_tags );
                       break;
                   // Ordered list
                   case "olist":
                       $html_tags = array(
                           'wrapper_o' => "<ol class='nlposts-wrapper nlposts-olist $wrapper_list_css'>",
                           'wrapper_c' => "</ol>",
                           'wtitle_o' => "<h2 class='nlposts-olist-wtitle'>",
                           'wtitle_c' => "</h2>",
                           'item_o' => "<li class='nlposts-olist-litem'>",
                           'item_c' => "</li>",
                           'content_o' => "<div class='nlposts-container nlposts-olist-container $nlp_instance'>",
                           'content_c' => "</div>",
                           'meta_o' => "<span class='nlposts-olist-meta'>",
                           'meta_c' => "</span>",
                           'thumbnail_o' => "<ul class='nlposts-olist-thumbnail thumbnails'>",
                           'thumbnail_c' => "</ul>",
                           'thumbnail_io' => "<li class='nlposts-olist-thumbnail-litem span3'>",
                           'thumbnail_ic' => "</li>",
                           'pagination_o' => "<div class='nlposts-olist-pagination pagination'>",
                           'pagination_c' => "</div>",
                           'title_o' => "<h3 class='nlposts-olist-title'>",
                           'title_c' => "</h3>",
                           'excerpt_o' => "<ul class='nlposts-olist-excerpt'><li>",
                           'excerpt_c' => "</li></ul>",
                           'caption_o' => "<div class='nlposts-caption'>",
                           'caption_c' => "</div>"
                       );
                       $html_tags = apply_filters( 'nlposts_olist_output', $html_tags );
                       break;
                   // Block
                   case "block":
                       $html_tags = array(
                           'wrapper_o' => "<div class='nlposts-wrapper nlposts-block $wrapper_block_css'>",
                           'wrapper_c' => "</div>",
                           'wtitle_o' => "<h2 class='nlposts-block-wtitle'>",
                           'wtitle_c' => "</h2>",
                           'item_o' => "<div class='nlposts-block-item'>",
                           'item_c' => "</div>",
                           'content_o' => "<div class='nlposts-container nlposts-block-container $nlp_instance'>",
                           'content_c' => "</div>",
                           'meta_o' => "<span class='nlposts-block-meta'>",
                           'meta_c' => "</span>",
                           'thumbnail_o' => "<ul class='nlposts-block-thumbnail thumbnails'>",
                           'thumbnail_c' => "</ul>",
                           'thumbnail_io' => "<li class='nlposts-block-thumbnail-litem span3'>",
                           'thumbnail_ic' => "</li>",
                           'pagination_o' => "<div class='nlposts-block-pagination pagination'>",
                           'pagination_c' => "</div>",
                           'title_o' => "<h3 class='nlposts-block-title'>",
                           'title_c' => "</h3>",
                           'excerpt_o' => "<div class='nlposts-block-excerpt'><p>",
                           'excerpt_c' => "</p></div>",
                           'caption_o' => "<div class='nlposts-caption'>",
                           'caption_c' => "</div>"
                       );
                       $html_tags = apply_filters( 'nlposts_block_output', $html_tags );
                       break;
                   default:
                       // Unordered list
                       $html_tags = array(
                           'wrapper_o' => "<ul class='nlposts-wrapper nlposts-ulist $wrapper_list_css'>",
                           'wrapper_c' => "</ul>",
                           'wtitle_o' => "<h2 class='nlposts-ulist-wtitle'>",
                           'wtitle_c' => "</h2>",
                           'item_o' => "<li class='nlposts-ulist-litem'>",
                           'item_c' => "</li>",
                           'content_o' => "<div class='nlposts-container nlposts-ulist-container $nlp_instance'>",
                           'content_c' => "</div>",
                           'meta_o' => "<span class='nlposts-ulist-meta'>",
                           'meta_c' => "</span>",
                           'thumbnail_o' => "<ul class='nlposts-ulist-thumbnail thumbnails'>",
                           'thumbnail_c' => "</ul>",
                           'thumbnail_io' => "<li class='nlposts-ulist-thumbnail-litem span3'>",
                           'thumbnail_ic' => "</li>",
                           'pagination_o' => "<div class='nlposts-ulist-pagination pagination'>",
                           'pagination_c' => "</div>",
                           'title_o' => "<h3 class='nlposts-ulist-title'>",
                           'title_c' => "</h3>",
                           'excerpt_o' => "<ul class='nlposts-ulist-excerpt'><li>",
                           'excerpt_c' => "</li></ul>",
                           'caption_o' => "<div class='nlposts-caption'>",
                           'caption_c' => "</div>"
                       );
                       $html_tags = apply_filters( 'nlposts_default_output', $html_tags );
                       break;
           }
           // Return tags
           return $html_tags;
       }
       ```
   
 * Check if there is a new one added, or the one for blocks was modified and replace
   it in the latest version.
 * I know this is not ideal but the only way to keep customizations right now. I
   am working in a new version which will allow developers to create their own styles
   without losing them once the plugin gets updated.
 * Please let me know if you need further assistance.
 * Best regards,
    Jose SAYAGO.
 *  Thread Starter [megseoh](https://wordpress.org/support/users/megseoh/)
 * (@megseoh)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238215)
 * Hey Jose,
 * You were bang on – in the older version the ‘case “block”:’ had been entirely
   commented out & replaced by custom code. I’m very close to formatting it as it
   was before thanks to your help. Now that I know where the problem is I can easily
   paste it into newer versions.
 * One weird thing that has happened is it now says ‘network-latest-posts’ up in
   the top left corner under the <body> tag. Do you know where that would be coming
   from? [http://grab.by/I9MU](http://grab.by/I9MU)
 * Thanks again!
 *  Plugin Author [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * (@iluminatus)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238216)
 * Hi, I checked my testing environment and there is nothing being printed under
   the body tag. Could you please send me a copy of your `network-latest-posts.php`
   to `jose[at]wplatino.com` so I can take a look and see if there’s an extra tag
   causing this?
 * Kind regards,
    Jose SAYAGO.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Notice: Undefined variable: display formatting errors’ is closed to new
replies.

 * ![](https://s.w.org/plugins/geopattern-icon/network-latest-posts_61c601.svg)
 * [Network Latest Posts](https://wordpress.org/plugins/network-latest-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/network-latest-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/network-latest-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/network-latest-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/network-latest-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/network-latest-posts/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)
 * [undefined](https://wordpress.org/support/topic-tag/undefined/)

 * 7 replies
 * 2 participants
 * Last reply from: [Jose Luis SAYAGO](https://wordpress.org/support/users/iluminatus/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/notice-undefined-variable-display-formatting-errors/#post-6238216)
 * Status: resolved