• We suspect the recent update has borked many of our pages, the link above is probably the simplest example.

    This theme was built by a company that went under during the pandemic, and I’m out of my league trying to figure out how to repair the issue. But I do believe I can follow any instructions you could provide!

    The basic issue seems to be with layout — I’m not seeing any missing content (so far).

    Thank you!

    -don

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter dmcclain

    (@dmcclain)

    Our error log is pointing out

    PHP Notice: Undefined variable: _post in /var/www/html/wordpress/wp-content/themes/grady/template-parts/degree-faculty.php on line 52 (that’s the line with $post_thumb = get_the_post_thumbnail_url( $_post->ID, 'full' );

    <?php
                $i = 1;
                foreach($posts as $post):
            ?>
                <?php if($i%4 == 1) echo '<div class="grid">'; ?>
    
                    <div class="grid__item col-1-1 s--col-1-2 l--col-1-4">
                        <div class="faculty-block">
                            <a href="<?php echo get_permalink(); ?>">
                                <?php
                                    $post_thumb = get_the_post_thumbnail_url( $_post->ID, 'full' );
                                    if($post_thumb):
                                    echo '<img src="'.$post_thumb.'" alt="'.get_the_title().'" class="faculty-block_image"/>';
                                    else:
                                    echo '<img src="'.get_stylesheet_directory_uri().'/assets/img/headshot_bulldog.jpg" alt="'.get_field('first_name').'" class="faculty-block_image"/>';
                                    endif;
    
                                    $firstname = get_field('first_name').' ';
                                    $lastname = get_the_title();
                                    $fullname = $firstname.' '.$lastname;
                                    $title = get_field('faculty_title');
                                    $departments = get_field('primary_dept');
                                ?>
                                <span class="faculty-block_content vertical_center">
                                    <span class="faculty-block_name"><?php echo $fullname; ?></span>
                                    <span class="faculty-block_title"><?php echo $title; ?></span>
                                    <span class="faculty-block_department"><?php echo $departments; ?></span>
                                </span>
                            </a>
                        </div>
                    </div>
                <?php if($i%4 == 0) echo '</div>'; ?>
                   
            <?php 
                $i++;
                endforeach;
                if($count%4 != 1) echo "</div>";
                wp_reset_postdata();
            ?>
            </div>
        </div>
        <?php endif; ?>
    Thread Starter dmcclain

    (@dmcclain)

    Another error with similar message

    Notice: Undefined variable: post_id in /var/www/html/wordpress/wp-content/themes/grady/single.php on line 38

    post_ID seems to be causing errors, is this related to ACF?

    Plugin Author Delicious Brains

    (@deliciousbrains)

    Hi,

    Sorry to hear you ran into issues with the update. We haven’t had any similar reports of the $post_id getting messed up, so it’d be good to get to the bottom of this.

    Regarding the first notice, I can’t really see how that would interfere with the layout, since as far as I can tell the $_post variable is just being being used to grab the image for the faculty members.

    Have you tried temporarily reverting back to 5.10.2 (preferably on a dev/staging site) to see if that resolves the layout issue? Was anything else updated at the same time as ACF?

    Thread Starter dmcclain

    (@dmcclain)

    Thanks for being here!

    Yes, ACF was the only plugin we’ve had update.

    I don’t have access to a dev site, so I can’t roll back to a previous version of ACF as a test.

    I will keep checking back to see if anyone else has similar issues, thanks again for your attention.

    -d

    Thread Starter dmcclain

    (@dmcclain)

    This issue can be put to rest, it was not ACF at all.

    We’ve had success deactivating the plugin which updated just before yours, thank you for your patience while we investigated. You may feel free to remove this post altogether — sorry and thank you again!

    -don

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Error after updating to v5.11’ is closed to new replies.