Async loading aur preload rules
search script snippet-item r-snippetized under <div class
paste this code just below it
<!-- Async loading of scripts -->
<script async src="your-script.js"></script>
<!-- Preload rule for resources -->
<link rel="preload" href="your-resource.css" as="style" />
</div>
2. lazy load
paste this code just above </body> in the theme html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lazy Loading Images</title>
<style>
/* Some basic styling for demonstration */
.image-container {
width: 300px;
height: 200px;
border: 1px solid #ccc;
margin: 10px;
}
</style>
</head>
<body>
<!-- Your content before lazy loading images -->
<div class="image-container">
<img class="lazy" data-src="path_to_your_image.jpg" alt="Lazy Loaded Image">
</div>
<!-- Other images using similar structure -->
<script>
document.addEventListener("DOMContentLoaded", function() {
let lazyImages = document.querySelectorAll('.lazy');
let lazyImageObserver = new IntersectionObserver(function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
let lazyImage = entry.target;
lazyImage.src = lazyImage.dataset.src; // Load the image by setting the src attribute
lazyImage.classList.remove('lazy'); // Remove the class to prevent re-loading on subsequent intersections
lazyImageObserver.unobserve(lazyImage); // Stop observing this image
}
});
});
lazyImages.forEach(function(lazyImage) {
lazyImageObserver.observe(lazyImage);
});
});
</script>
<!-- Your content after lazy loading images -->
</body>
</html>
Add code for AJAX
paste this code just above the </body> tag in html theme
<!-- Place this code in the <head> tag or right before the closing </body> tag --> <script defer src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
preload and Async rule for title featured popular and blog post
paste this code just above the </body> tag in html theme
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dynamic Content Example</title>
<style>
/* Basic styling for demonstration */
.featured {
font-weight: bold;
color: blue;
}
.popular {
color: green;
}
.blog-post {
color: black;
}
</style>
<!-- Preloading styles -->
<link rel="preload" href="styles.css" as="style">
<!-- Async loading of script -->
<script async src="your-script.js"></script>
</head>
<body>
<h1 id="page-title">Title</h1>
<div class="featured" id="featured-post">Featured Post</div>
<div class="popular" id="popular-post">Popular Post</div>
<div class="blog-post" id="blog-post">Blog Post</div>
<script>
// Replace these placeholders with your actual content
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('page-title').innerText = 'My Blog';
document.getElementById('featured-post').innerText = 'Featured: Post 1';
document.getElementById('popular-post').innerText = 'Popular: Post 2';
document.getElementById('blog-post').innerText = 'Recent Blog: Post 3';
});
</script>
</body>
</html>
add this👇 yellow code just below the <div class='snippet-item r-snippetized'>
<b:includable id='userProfileText'>
<dd class='profile-textblock profile-snippet snippet-container r-snippet-container'>
<div class='snippet-item r-snippetized'>
<div class='snippet-item r-snippetized'>
<!-- Async loading of scripts -->
<script async src="your-script.js"></script>
<!-- Preload rule for resources -->
<link rel="preload" href="your-resource.css" as="style" />
</div>
<data:aboutme/>
</div>
<div class='snippet-fade r-snippet-fade show'/>
.heroPost .big-post-text{
background-color:$(heropost.secondary.background.color);
box-sizing:border-box;
color:$(heropost.secondary.text.color);
-webkit-box-flex:1;
-webkit-flex:1 1 auto;
-ms-flex:1 1 auto;
flex:1 1 auto;
min-width:0;
padding:48px
}
/* Default styles for big-post-text */
.heroPost .big-post-text {
background-color: $(heropost.secondary.background.color);
box-sizing: border-box;
color: $(heropost.secondary.text.color);
-webkit-box-flex: 1;
-webkit-flex: 1 1 auto;
-ms-flex: 1 1 auto;
flex: 1 1 auto;
min-width: 0;
padding: 48px;
}
/* Default styles for big-post-text */
.heroPost .big-post-text {
/* Existing styles */
display: flex; /* Changing display property to flex */
align-items: center; /* Centering content vertically */
white-space: nowrap; /* Preventing text from wrapping */
}
/* Targeting text within big-post-text for horizontal display */
.heroPost .big-post-text p,
.heroPost .big-post-text span,
.heroPost .big-post-text h1,
.heroPost .big-post-text h2,
.heroPost .big-post-text h3,
.heroPost .big-post-text h4,
.heroPost .big-post-text h5,
.heroPost .big-post-text h6 {
display: inline; /* Making text inline */
}
/* Media query for responsiveness */
@media screen and (max-width: 600px) {
.heroPost .big-post-text {
/* Adjustments for smaller screens */
padding: 24px; /* Adjusted padding for smaller screens */
/* Any other styles for smaller screens */
}
problem will be solved
.tab-title {
writing-mode: horizontal-tb; /* Title ko horizontal layout mein display karega */
}
#post me image or media nahi hote hai to ye mere content ko display karte hai as media display karte ahi and phir container me text fit nahi hota hia content ka kyoki ye responsive nahi hai isko solve karne ke liye kya kiya jana chahiye
<p>This is a simple HTML code</p>
<div class='post-content container'> <!-- WebP Image --> <img src="image.webp" alt="WebP Image" loading="lazy" type="image/webp"> <!-- JPEG Image --> <img src="image.jpg" alt="JPEG Image" loading="lazy" type="image/jpeg"> <!-- PNG Image --> <img src="image.png" alt="PNG Image" loading="lazy" type="image/png"> <!-- GIF Image --> <img src="image.gif" alt="GIF Image" loading="lazy" type="image/gif"> </div>
<p>This is a simple HTML code</p>
<p>This is a simple HTML code</p>
<p>This is a simple HTML code</p>
<p>This is a simple HTML code</p>
<p>This is a simple HTML code</p>



Comments
Post a Comment