Site logo

Archived topic

Short code added to front page overrules settings in layout element

5 replies · Started by Carsten on April 7, 2021

Viewing posts 1–6 of 6

Hi there, for some reason adding this short code added to my front page, also displays my sidebars, even though
No sidebars is selected both in the page layout and in the Sidebar Layout Content (no sidebars) in my layout element with front page selected in display rules.

So this short code overrules all settings, how is this possible?

[lrm_form default_tab="login" logged_in_message="You are currently logged in!"]

Thanks!

Hi Carsten,

Any chance you can share the credentials in the private information field?
So we can log in and have a look.

Let me know :)

Sure, credentials attached

The settings seem normal, could you try to disable all plugins except GP Premium, Generateblocks and the plugin that generates the shortcode to test?

Let me know :)

Thanks for looking into this.

To make the layout element work on my register page, I have to add this code below. Maybe it's the same for the front page, that it need some code to make it work?

 //code from GeneratePress 

add_filter( 'generate_layout_element_display', function( $display, $element_id ) {
    if ( 47823 === $element_id ) {
        if ( function_exists( 'bp_is_register_page' ) && bp_is_register_page() ) {
            return true;
        }
    }

    return $display;
}, 10, 2 );

To make the layout element work on my register page, I have to add this code below. Maybe it’s the same for the front page, that it need some code to make it work?

That's strange that you should need this to make it work. Does the display rule not work completely?

If the code works, perhaps we can edit it to add the from page in.

Example:

add_filter( 'generate_layout_element_display', function( $display, $element_id ) {
    if ( 47823 === $element_id ) {
        if ( is_front_page() || function_exists( 'bp_is_register_page' ) && bp_is_register_page() ) {
            return true;
        }
    }

    return $display;
}, 10, 2 );

is_front_page() is basically including the home page or front page to the mix of conditions.

Let us know how it goes.

This archived topic is closed to new replies.