Home › Forums › Jevelin Theme › Disable dynamic IDs in theme
Home › Forums › Jevelin Theme › Disable dynamic IDs in theme
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.
Errors in the original stylesheet:
Fixed stylesheet in test website:
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>
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
If you need services beyond standard support, we've got your back!
If you'd prefer not to handle the installation yourself or need help getting started, we'll set everything up for you.
We'll help you rearrange sections, adjust spacing, and modify the page structure to fit your needs.
More complex styling changes, theme option modifications, and third-party integrations.
If you need something that's not included in the theme, we can code it for you.
Web design services to create custom sections, pages, and blocks for your theme, plus graphics and visualizations.
Full website builds, custom theme development, or plugin creation from scratch.
We'll provide a clear quote based on what you need. No hidden fees.