Title: Error: Undefined variable: post_title
Last modified: April 21, 2021

---

# Error: Undefined variable: post_title

 *  Resolved [Ludwig C.](https://wordpress.org/support/users/ludwig-c/)
 * (@ludwig-c)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-undefined-variable-post_title/)
 * When enabling debug mode in WP I get the following notices:
    `Notice: Undefined
   variable: post_title in /app/web/wp-content/plugins/ultimate-responsive-image-
   slider/layout.php on line 332`
 * Seems to be related to:
    [Error on testing site, undefined](https://wordpress.org/support/topic/error-on-testing-site-undefined/#post-12474533)
 * I fixed it by moving the assignment of $post_title outside of the if condition.
 *     ```
       ---
        .../plugins/ultimate-responsive-image-slider/layout.php       | 4 +++-
        1 file changed, 3 insertions(+), 1 deletion(-)
   
       diff --git a/web/wp-content/plugins/ultimate-responsive-image-slider/layout.php b/web/wp-content/plugins/ultimate-responsive-image-slider/layout.php
       index 2bcfeb6..b9af0cd 100644
       --- a/web/wp-content/plugins/ultimate-responsive-image-slider/layout.php
       +++ b/web/wp-content/plugins/ultimate-responsive-image-slider/layout.php
       @@ -224,8 +224,10 @@ document.addEventListener("DOMContentLoaded", function(event) {
        /* Custom CSS */
        <?php echo $WRIS_L3_Custom_CSS; ?>
        </style>
       +<?php $post_title = get_the_title( $post_id );?>
        <?php  if($WRIS_L3_Slide_Title) { ?>
       -<h3 class="uris-slider-post-title"><?php echo $post_title = get_the_title( $post_id ); ?></h3>
       +
       +<h3 class="uris-slider-post-title"><?php echo $post_title; ?></h3>
        <?php } if($TotalSlideIds>0){ ?>
        		<div id="slider-pro-3-<?php echo $post_id; ?>" class="slider-pro">
        			<!---- slides div start ---->
       -- 
       ```
   

Viewing 1 replies (of 1 total)

 *  Plugin Author [FARAZFRANK](https://wordpress.org/support/users/farazfrank/)
 * (@farazfrank)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/error-undefined-variable-post_title/#post-14351272)
 * Really sorry for the delay in reply.
 * Thanks for this valuable feedback, I will fix this bug in the next update.
 * You can also ping me I forgot.
 * Rate [here](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/reviews/),
   my work if you like.
 * Thanks

Viewing 1 replies (of 1 total)

The topic ‘Error: Undefined variable: post_title’ is closed to new replies.

 * ![](https://ps.w.org/ultimate-responsive-image-slider/assets/icon-128x128.gif?
   rev=2305926)
 * [Ultimate Responsive Image Slider](https://wordpress.org/plugins/ultimate-responsive-image-slider/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ultimate-responsive-image-slider/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/)
 * [Active Topics](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ultimate-responsive-image-slider/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [FARAZFRANK](https://wordpress.org/support/users/farazfrank/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/error-undefined-variable-post_title/#post-14351272)
 * Status: resolved