Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #110172
    paulisjob
    Participant

    Hello. I recently added a shortcode to display blog posts in my websites front page, and when the post is clicked, this message pops up: “Notice: Undefined variable: metabox_feat_img in /home/vol9_4/byethost10.com/b10_17487215/htdocs/wp-content/themes/parallax-frame/inc/core.php on line 1302”

    You can see it yourself here: http://paulinasjoberg.com/hello-world/

    When I go to the 1302nd line in core.php, this is what I see: if ( ‘default’ == $metabox_feat_img ) {

    I’m not too tech savvy with code, and id love if you could help me figure out how to fix this error. Thank you!

    #110181
    Pratik
    Participant

    Hi @paulisjob,

    We have fixed this issue and it will be solved in next version. We may release by monday. If you want it solved asap, replace function fron line 1272 to line 1316 as follows:

    
    function parallax_frame_single_content_image() {
    		global $post, $wp_query;
    
    		// Get Page ID outside Loop
    		$page_id = $wp_query->get_queried_object_id();
    		if ( $post) {
    	 		if ( is_attachment() ) {
    				$parent = $post->post_parent;
    				$metabox_feat_img = get_post_meta( $parent,'parallax-frame-featured-image', true );
    			} else {
    				$metabox_feat_img = get_post_meta( $page_id,'parallax-frame-featured-image', true );
    			}
    		}
    
    		if ( empty( $metabox_feat_img ) || ( !is_page() && !is_single() ) ) {
    			$metabox_feat_img = 'default';
    		}
    
    		// Getting data from Theme Options
    	   	$options = parallax_frame_get_theme_options();
    
    		$featured_image = $options['single_post_image_layout'];
    
    		if ( ( 'disable' == $metabox_feat_img  || '' == get_the_post_thumbnail() || ( $metabox_feat_img=='default' && 'disabled' == $featured_image ) ) ) {
    			echo '<!-- Page/Post Single Image Disabled or No Image set in Post Thumbnail -->';
    			return false;
    		}
    		else {
    			$class = '';
    
    			if ( 'default' == $metabox_feat_img ) {
    				$class = $featured_image;
    			}
    			else {
    				$class = 'from-metabox ' . $metabox_feat_img;
    				$featured_image = $metabox_feat_img;
    			}
    
    			?>
    			<figure class="featured-image <?php echo esc_attr( $class ); ?>">
                    <?php the_post_thumbnail( $featured_image ); ?>
    	        </figure>
    	   	<?php
    		}
    	}
    

    Regards,
    Pratik

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Notice: Undefined variable: metabox_feat_img’ is closed to new replies.