Site logo

Archived topic

New version of Generate Press broke my child theme

9 replies · Started by Sue on April 5, 2020

Viewing posts 1–10 of 10

I updated GP to the new version, as I've done many times in the past, since I use a child theme on this site. However, this time, the GP update broke the portfolio items on the site. I pasted the URL of one of the portfolio items into the box below. If you go to archive.org and look up a previous version of the page in the wayback machine, you'll see what it is supposed to look like. The rest of the site looks fine; it's just the portfolio.

If it's an easy fix, perhaps you can let me know what to do? Otherwise, I'm afraid I may have to revert to an older version of GP. Thank you!

Hi there,

I'm not sure if understand.

A child theme is empty by default with 2 empty files - style.css and function.php.

It simply grabs the file from the parent theme.

What did you add to your child theme previously?

My child theme has more stuff in it than just a style.css and function.php -- however, it worked perfectly through all the previous upgrades, so I was wondering if there was something in the new GP version that specifically addressed portfolio items. This file, single-portfolio.php, is in my child theme:

<?php
/**
* The Template for displaying all single posts.
*
* @package GeneratePress
*/

if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}

get_header(); ?>

>
<main id="main" <?php generate_main_class(); ?>>
<?php
/**
* generate_before_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_before_main_content' );

while ( have_posts() ) : the_post();

$amazon = get_field('purchase_link_amazon');
get_template_part( 'content', 'single' );

// If comments are open or we have at least one comment, load up the comment template.
//if ( comments_open() || '0' != get_comments_number() ) : ?>

<!--

<?php //comments_template(); ?>

-->

<?php //endif;

endwhile;

/**
* generate_after_main_content hook.
*
* @since 0.1
*/
do_action( 'generate_after_main_content' );
?>
</main><!-- #main -->

<!-- #primary -->

<?php
/**
* generate_after_primary_content_area hook.
*
* @since 2.0
*/
do_action( 'generate_after_primary_content_area' );

// generate_construct_sidebars();

get_footer();

This is kind of urgent since the person in question has a new book coming out on Tuesday, so would it be possible for me to get the previous version of GP to reinstall until I can figure this out? Is there a place where I can download older versions?

Hi there,

The latest GeneratePress only made CSS changes to the block editor - it didn't change anything on the frontend.

Your page looks like it's encountering a PHP error. What happens if you temporarily remove that template file from the change (or change the name)?

What's the template doing? It may be possible to ditch it completely.

Let me know :)

I renamed the file -old and if you reload it, now it works again, BUT it's not as nicely formatted as it was before. So I guess that's what the template was doing -- making it prettier.

What about it was prettier?

If you want to use the template, you'll need to turn on WP_DEBUG to see if a PHP error is happening: https://wordpress.org/support/article/debugging-in-wordpress/

Otherwise, we can likely accomplish the same look without the template, but I will need to know what needs changing.

The change was in a WordPress update that happened at roughly the same time as the theme update. The behavior of "get_field" changed, and the child template made heavy use of the previous use of "get_field". Thank you for your help.

Please close the ticket.

Glad you got it working :)

This archived topic is closed to new replies.