-
Search Results
-
Hi.
I have a few different user Roles and I want to hide certain elements on the homepage based on the Role.Have a look at the Home page. When I log in as a certain user, the elements are hidden, but the spaces are left where they were, making the layout have gaps all over where the elements have been removed.
The following is what I have tried, but I am not sure if I am targeting the correct elements.
JavaScript:
document.addEventListener(“DOMContentLoaded”, function () {
console.log(“Custom.js is running”);
console.log(“User Data:”, userData);const userRole = userData.role.toLowerCase(); // Convert role to lowercase for comparison
console.log(“User Role:”, userRole);if (userRole === “mrpi_user”) {
console.log(“Role matches MRPI User. Waiting for elements to load…”);const interval = setInterval(function () {
// Specify the elements to remove
const elementsToRemove = [
document.getElementById(“Wholesaler_Element_Homepage”),
document.getElementById(“Products_Element_Homepage”),
];let allElementsFound = true;
// Loop through the elements to remove
elementsToRemove.forEach(function (element) {
if (element) {
console.log(“Removing element:”, element);
element.remove(); // Remove the specific element
} else {
console.log(“Element not found yet.”);
allElementsFound = false; // Keep checking if any element is not found
}
});// Stop checking when all elements are removed
if (allElementsFound) {
clearInterval(interval);
}
}, 100); // Check every 100ms
} else {
console.log(“Role does not match. Skipping element removal.”);
}
});CSS:
#av_section_2 {
display: flex; /* Enable flexbox layout */
flex-wrap: wrap; /* Allow items to wrap to the next row if necessary */
justify-content: flex-start; /* Align items to the left */
padding: 0; /* Remove internal padding */
margin: 0; /* Remove external margins */
height: auto; /* Adjust height dynamically */
gap: 10px; /* Optional: Add spacing between items */
}#av_section_2 > .flex_column {
flex: 1 1 auto; /* Allow items to grow and shrink dynamically */
margin: 0; /* Remove margin between elements */
padding: 0; /* Remove internal padding */
}HTML:
<div id=”Wholesaler_Element_Homepage”></div>
<div id=”Products_Element_Homepage”></div>Topic: Post Not Appear on News Page
Hello,
I published a post this morning and, for the first time in going on 20 years of using Enfold, it didn’t appear at the top, or indeed anywhere, on my News page. It can be found at it’s own URL, and appears on at the top of the “Recent” widget list on other blog pages, but not on the blog landing/News page.I’m using Enfold v. 18-01-14 with WordPress v. 6.6.2.
Appreciate your advice to fix this. Thanks! Lance
Hi,
I have a problem with archive pages of categories. They show a noindex in the header.
In the general settings of wordpress for reading the option „prevent search engines from indexing“ ist NOT chosen. (While testing I had this option chosen.)
In the SEO-Tool the categories are set to be indexed. In source code you can see this at the top.
Do you have any idea how to fix this?Thank you.
Best regards,
VeraI’m unable to figure out why my Enfold site has stopped working. Except for the Contact page, nothing appears below the header menu. I’ve removed my caching plugin, updated to the most current version of Enfold, and searched for suggestions about what the problem might be with no luck.
I’m including Private Content so you can take a look at the back end also.
Viewing 30 results - 2,881 through 2,910 (of 142,850 total)




