Skip to content

Instantly share code, notes, and snippets.

View faisalahammad's full-sized avatar
🎯
Focusing

Faisal Ahammad faisalahammad

🎯
Focusing
View GitHub Profile
<script>
jQuery(document).ready(function($) {
setTimeout(function() {
$('.et_pb_gallery_pagination a').click(function(event) {
event.preventDefault();
$('html, body').animate({
scrollTop: 0
}, 'smooth');
});
}, 1000);
@faisalahammad
faisalahammad / gravity-forms-move-progress-bar-bottom.php
Created February 3, 2024 22:00 — forked from n7studios/gravity-forms-move-progress-bar-bottom.php
Gravity Forms - Move Progress Bar to Bottom of Form
<?php
/**
* Plugin Name: Gravity Forms: Move Progress Bar to Bottom of Form
* Plugin URI: http://www.n7studios.co.uk
* Version: 1.0.0
* Author: n7 Studios
* Author URI: http://www.n7studios.co.uk
* Description: Moves the progress bar from the top to the bottom of the Gravity Form. The Start Paging section of the form MUST have a CSS class = progress-bar-bottom
*/
nav ul#menu-header .sub-menu {
width: max-content !important;
}
nav ul#menu-header .sub-menu li {
display: block !important;
}
nav ul#menu-header .sub-menu li a {
width: auto !important;
add_filter( 'gform_post_category_args', 'allow_specific_categories', 10, 2 );
function allow_specific_categories( $args, $field ) {
// add allowed category IDs
$allowed_categories = array( 12, 34, 56 );
if ( isset( $args['include'] ) && is_array( $args['include'] ) ) {
$args['include'] = array_merge( $args['include'], $allowed_categories );
} else {
$args['include'] = $allowed_categories;
<?php // Replace the numbered months with named months in a Gravity Forms dropdown date field
add_action( 'wp_footer', function () { ?>
<script type="text/javascript">
jQuery(document).ready(function( $ ) {
$('.gfield_date_dropdown_month select option').each( function(i, option) {
switch( option.value ) {
case '1': option.innerHTML = 'January'; break;
case '2': option.innerHTML = 'February'; break;
case '3': option.innerHTML = 'March'; break;
/* 4 */
#top-navigation-bar {
background: #6391f3;
border-top: 1px solid #6391f3;
border-bottom: 1px solid #6391f3;
margin-top: 10px;
}
.sf-menu li {
background-color: #6391f3;
<Navbar bg="dark" variant="dark" className="mb-5" sticky="top" expand="lg">
<Container>
<Link to="/" className="navbar-brand">
Genius Car Mechanics
</Link>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="ms-auto">
<Link to="/home" className="nav-link">
Home

If you're using Vite⚡️then you might be face hard time to located your assets. Because it's not working like create-react-app (CRA). So if you located your file inside sub-folder of src, it'll not include on build process.

Here is the solution:

  1. Create a public folder in root directory.
  2. Create sub-folder for assets.
  3. Import images from public/images/ like this way const errorImg = new URL("/images/404-page.jpg", import.meta.url);. So you've to start with /folder/asset.ext then it'll be included in the build process.
<script text= "text/javascript">
jQuery(function($){
function stickyFooter(){
var footer = jQuery("#et-main-area footer");
var position = footer.position();
var height = jQuery(window).height();
height = height - position.top;
height = height - footer.outerHeight();
if (height > 0) {
footer.css({'margin-top' : height+'px'});

The Blog Module is using AJAX to load older posts. When you click on the older entries button the Blog module is reloading instead of refreshing the entire page. This is the way that AJAX works.

The pagination links have the ?et_blog parameter to avoid pagination clashes with the main query. It has no impact on SEO since the URLs have the "canonical" URL set to the main page.

In some cases, you may want to refresh the page to apply custom styles or in order to see the URL of the next page.

To disable AJAX, place this code to the Divi > Theme Options > Integration > Add code to the < head > of your blog: