Disable dynamic IDs in theme

Home Forums Jevelin Theme Disable dynamic IDs in theme

Home Forums Jevelin Theme Disable dynamic IDs in theme

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • cooltronic
    Participant

    Hello,

    I am using WP Rocket.

    I checked the IDs are dynamically generated, but I want them to be unique and static for ex. 24 hours for WP Rocket CSS optimization.

    How do achieve this?

    Also, I checked the plugins.css file, it has some parse errors.

    I fixed errors because when the CSS was processed by the RUCSS of the WP ROCKET algorithm it was broken. I am attaching a fixed file for you.

    cooltronic
    Participant

    I changed jevelin_rand() function.

    The many attributes were passed to the element so if we add the first 20 chars to the id of the attributes array it will be unique.

    Function inserted in helpers.php function jevelin_entity:
    <div>

     /**
    
      * Create Custom Random Function.
    
      */
    
     function jevelin_rand($length = 10)
    
     {
    
         return substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length / strlen($x)))), 1, $length);
    
     }
     //function which returns first 20 chars of string, typically $atts from each element
     function jevelin_entity($className)
    
     {
    
         return substr(preg_replace('/\W+/', '', strtolower(strip_tags(implode('_', $className)))), 0, 20);
    
     }

    </div>
    The first characters are given when we use instead of jevelin_rand(), the new function generates static assigned unique IDs names, but we must pass $atts in each element.

    Example of use in elements instead of rand:
    <div>

    $id = 'sh-text-group-'.jevelin_entity($atts);

    <div>

    $element_id = 'vc_column_'.jevelin_entity($atts);

    </div>

    </div>

    Shufflehound
    Moderator

    Hi there,

     

    Thank you for letting this know. 🙂

    At the moment we are not sure if need to help on something further for this topic.

     

    Best regards,

    Shufflehound team

Viewing 4 posts - 1 through 4 (of 4 total)

Popular choice

Professional Developers At Your Fingertips!

If you need services beyond standard support, we've got your back!

Services we offer:

Demo setup
Advanced customization
Layout adjustment
Graphic work / visualizations
Custom coding
Full WordPress development and design

Services

What we can offer

  • Demo setup +

    If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.

  • Layout adjustment +

    We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.

  • Advanced customization +

    More complex styling changes, theme option modifications, and third-party integrations.

  • Custom coding +

    If you need something that's not included in the theme, we can code it for you.

  • Graphic work / visualizations +

    Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.

  • Full WordPress development and design +

    Full website builds, custom theme development, or plugin creation from scratch.

  • About pricing +

    We'll provide a clear quote based on what you need. No hidden fees.

Professional Developers At Your Fingertips!

Custom Work Form