Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Dynamic Element

  • Now, I know what you means.

    I want the block Elementos appear here (where is the arrow in the screenshot). (It would be the last block before to start te footer)

    https://share.zight.com/12ulWmmd

  • OK,

    In the element list you can use either: after_main_content or before_footer

  • Ok,

    I have used “after_main_content” in both Elements with the same priority. Yo can take a look to the screenshot.

    https://share.zight.com/GGuBD8l4
    https://share.zight.com/wbux2rzx

    Will these elements change depending on the parameters defined in the snippet I have created?

    add_filter( ‘generate_element_display’, function( $display, $element_id ) {
    if (function_exists(‘rcp_count_memberships’)) {
    $total_suscriptores = rcp_count_memberships(array(‘status’ => ‘active’));
    $total_suscriptores = 101; //101
    if($total_suscriptores <= 100 && 3474 === $element_id){
    $display=false;
    }elseif( $total_suscriptores > 100 && 3492 === $element_id) {
    $display=false;
    }//fin_else
    }
    return $display;
    }, 10, 2 );
  • Yes, that Snippet should now work.
    Have you tried adding it ?

  • Yes, but for example when I change the parameter “total_suscriptores” to “0” or “101”, a lot of times Doesn’t show the block at the moment, Could it be the server cache? or what do you think it could be.

  • It could be a caching issue.
    Does the problem go away if you disable all caching ?

  • Exactly.

    I have deactivated the LiteSpeed Cache plugin and the change are made immediately.
    Any suggest or idea?

  • You will need to ask LiteSpeed support on how to eliminate that as I have no idea how their page caching works.

Viewing 8 posts - 17 through 24 (of 24 total)
  • You must be logged in to reply to this topic.