Site logo

Archived topic

Generatepress and Elementor pro wont work togheter

20 replies · Started by Jonas on May 19, 2018

Viewing posts 16–21 of 21

Yes, here's the fix if you don't want to wait for the update.

1. Open wp-content/plugins/gp-premium/page-header/functions/functions.php

2. On line 135, find this block of code:

if ( is_tax() || is_category() || is_tag() && ! $id && ! is_singular() ) {
	if ( isset( $global_locations[ get_queried_object()->taxonomy ] ) && '' !== $global_locations[ get_queried_object()->taxonomy ] && ! $id ) {
		$id = $global_locations[ get_queried_object()->taxonomy ];

		if ( 'publish' !== get_post_status( $id ) ) {
			$id = false;
		}
	}

	$tax_post_id = get_term_meta( get_queried_object()->term_id, '_generate-select-page-header', true );
	if ( '' !== $tax_post_id && 'publish' == get_post_status( $tax_post_id ) ) {
		$id = $tax_post_id;
	}
}

And replace it with:

if ( is_tax() || is_category() || is_tag() && ! $id && ! is_singular() ) {
	$queried_object = get_queried_object();

	if ( is_object( $queried_object ) ) {
		if ( isset( $global_locations[ $queried_object->taxonomy ] ) && '' !== $global_locations[ $queried_object->taxonomy ] && ! $id ) {
			$id = $global_locations[ $queried_object->taxonomy ];

			if ( 'publish' !== get_post_status( $id ) ) {
				$id = false;
			}
		}

		$tax_post_id = get_term_meta( $queried_object->term_id, '_generate-select-page-header', true );
		if ( '' !== $tax_post_id && 'publish' == get_post_status( $tax_post_id ) ) {
			$id = $tax_post_id;
		}
	}
}

prfct, you'r a legend, I am stocked by your support, never change!

Over at Elementor I got answers on the questions I didn't ask and ended up with this:

Vincent replied
May 23, 16:40
Hi Jonas,

You are correct currently the developers decided to disable the metabox capability with the generatepress filter generate_metabox_capability. This move seems intentional to prevent layout issue, by removing those options for the user.

You can report this as an issue/feature request on our GitHub project page, so the developers may consider reenabling this option.

Kind Regards,

--
Vincent from Elementor

Did you make the change above? If so, is everything back to normal? :)

Had a quick try but it didn't work unfortunately, I can't try more for the next few day's as I have to work :-(

and my server went down last night grrr()*&E(#%$$*$()*@#()_$@(#)$, but that is because i'm an idiot!Trying again in a couple of days time.
J

Hi Tom,

Any news on this issue?

Jonas

It's scheduled for GPP 1.7, which we're hoping to get out later this month.

We tested the above and it worked on all of our sites. Feel free to send us temporary admin login details and I can switch out the code for you: https://generatepress.com/contact/

This archived topic is closed to new replies.