Video Auto Embed problem with Kadence Virtue Premium Theme

Doesn’t sound like you’re going to get anywhere with Kadence tbh. They’ve obviously got a distorted view and are ignorant of the fact that around 19% of WordPress users are still on version 4.9 or less. That’s a sizeable chunk to ignore. And there are still many plugins and themes that work with WP 4.9 or less.

Here’s a list of plugins on the WP repo that mention support for ClassicPress: Search Results for “classicpress” | WordPress.org. Countless more will also work fine with CP as long as they are compatible with WP 4.9. This includes some big plugins such as Advanced Custom Fields. That’s in addition to our own successful forks of WooCommerce (Classic Commerce) and Rank Math (Classic SEO).

As for themes, three of the biggest selling themes of all time still support WP 4.9: Avada, Enfold and Flatsome,

What I personally would do is to roll back to the latest version of Virtue Premium that works with CP and gradually move sites over to a new theme.

3 Likes

What is it that you particularly like about that theme?

Edit: I would also do what @1stepforward suggests. But if we know what you like about Virtue Premium, it might be easier to recommend an alternative.

2 Likes

Hi @timkaye ,
I like that it has very flexible header choices (logo left, logo right, logo centered) and menu locations (above header, below header, etc). I like the theme settings menu and I like the way you can easily set theme colors, fonts and section background colors. I like to keep design separate from the editor.

By using a theme that has these options, I can use the same theme for any design we are asked to do and the settings are familiar to the whole team.

1 Like

Maintaining backward compatibility is absolutely the WordPress way. Deciding not to support older versions is one thing, making stuff up to support that decision is a whole other thing. I sincerely hope you’re able to switch away from the makers of that theme.

Regarding pushback…generally speaking, I’d avoid it, unless the theme specifically states that it supports WP 4.9 (because, if it did, then it would also work on ClassicPress,) in which case I’d ask them to update the theme or update the supported version number – both of which are reasonable requests.

4 Likes

@1stepforward thank your for these very good suggestions. I will definitely take your advice.

I am really disappointed to learn that Kadence has this view. We have supported them for a long time.

Thanks you for sharing the information about plugin support. I think Ben at Kadence is dead wrong about the plugins.

2 Likes

I wonder if the Amicable theme might offer the features you like: Amicable (ClassicPress Theme) Available

3 Likes

I’d give the Canuck CP theme a try. It has more options than a lot of premium themes and it is built by a ClassicPress community member who (I believe?!) was on the WP theme repo team for quite some time.

https://kevinsspace.ca/2020/12/canuck-cp-1-0-6/

4 Likes

Thank you all so much for this support!

I am going to test these themes and see what might work best for our group. And as @1stepforward suggests…

3 Likes

It’s also possible to work around an issue like this by modifying the theme code and/or adding a small custom plugin to the affected sites. I would expect more issues with this theme based on their response, so this would only be a stopgap solution, but if you’re interested in looking into this then feel free to send me a private message. To be clear this is something I am offering to investigate personally as a consultant outside of my role with ClassicPress.

2 Likes

@james thanks for this generous offer. I thought about this overnight, but it seems like a dead end continuing to use the Virtue Premium theme. Switching themes seems to be the best option.

1 Like

I have found a theme with a similar theme options interface to the one we are used to from Kadence. (Not as complicated or “block like” as Avada, Enfold or Flatsome.) The theme is Schema by MyThemeShop. When I asked if they would support ClassicPress, their answer was …

“ClassicPress is a fork of WordPress without the Gutenburg block editor, and our theme should work with ClassicPress. If it doesn’t work for you, we can issue you a refund.”

Hoping that means they will work with me. Still playing with the theme, but it looks like it will work for us.

Thank you all so much for your help!

3 Likes

Kadence offered to look at the error logs, and send along this error he found…

[17-Mar-2021 02:04:51 UTC] PHP Fatal error: Call to undefined function has_blocks() in /home1/chsalumn/public_html/wp-content/themes/virtue_premium/lib/cleanup.php on line 184

He points out has_blocks is a core WordPress function and theme developers will expect WordPress functions to exists. We should use a theme created for ClassicPress.

Some of his other remarks indicate that he is quite uninformed about ClassicPress. I told him it is my understanding that around 19% of WordPress users are still on version 4.9 or less . At least with ClassicPress, there is a team doing regular security updates and enhancements. That’s better than using an old abandoned version of Wordpress.

I thanked him for the information and encouraged him to learn more. I pointed out that Wordpress is moving to full site editing, which will make themes less relevant. But ClassicPress will always need themes. I told him Kadence would benefit by offering ClassicPress themes in the future. :smile:

5 Likes

If that function is the only thing preventing Kadence running on CP, then it should be easy to modify by adding a check for CP first, like this:
if ( function_exists( 'classicpress_version' ) ) { ...

3 Likes

In functions.php?

1 Like

Unfortunately not. It needs to be modified by the developer as part of the theme code (wherever its has_blocks check is). I was just pointing out how little Kadence might have to do to maintain compatibility with CP.

2 Likes

The function has_blocks() was introduced in version 5.0 of WordPress, hence the reason for the error in ClassicPress.

There’s no reason for this function to exist in CP as it is not block based.

As Tim says, there’s a very simple way around this - and one that fixes the problem of embeds not working.

If you’re using a child theme, in its functions.php add the following:

function remove_virtue_embed() {
	remove_filter( 'embed_oembed_html', 'virtue_embed_wrap', 90, 4 );
}
add_action( 'after_setup_theme', 'remove_virtue_embed', 91 );

function cp_virtue_embed_wrap( $cache, $url, $attr = '', $post_ID = '' ) {
	if ( ! function_exists( 'classicpress_version' ) ) {
		if ( ! has_blocks() ) {
			$cache = '<div class="entry-content-asset videofit">' . $cache . '</div>';
		}
	}
	return $cache;
}
add_filter( 'embed_oembed_html', 'cp_virtue_embed_wrap', 91, 4 );

I was only able to test this on the free version of the theme but it worked for me. It not only got rid of the error, it restored the standard WordPress embed functionality.

4 Likes

@1stepforward… Yippe! this code solved the problem! Thank you very, very much for your kind attention to this!

3 Likes

You’re welcome :slight_smile:

4 Likes

One takeaway from this, maybe we should consider creating a doc article about making WordPress theme compatible with ClassicPress. So users can send it to theme developers.

5 Likes

Yes, you’re right @viktor. That would be a good addition to the docs, although it is already covered to some extent here ClassicPress for Plugin Developers | ClassicPress.

For now at least, I think the use of function_exists( 'classicpress_version' ) would be best in the FAQ section of the docs, which is currently in the process of being updated (see ClassicPress-docs/faq-support.md at 47eb9a3c7bd4175599404a132aa0a59877a58ea3 · ClassicPress/ClassicPress-docs · GitHub). In due course, we’ll need to consider creating a separate page for theme and plugin developers to cover issues such as this.

I had been thinking of creating a short blog post about it too.

3 Likes