Skip to content

Instantly share code, notes, and snippets.

View prosantamazumder's full-sized avatar

Prosanta Mazumder prosantamazumder

View GitHub Profile
@prosantamazumder
prosantamazumder / function.php
Last active January 23, 2024 19:07
// let's add our custom class to the actual link tag
// let's add our custom class to the actual link tag
function atg_menu_classes($classes, $item, $args) {
if($args->theme_location == 'primary') {
$classes[] = 'nav-link';
}
return $classes;
}
add_filter('nav_menu_css_class', 'atg_menu_classes', 1, 3);
function add_menuclass($ulclass) {
@prosantamazumder
prosantamazumder / main.js
Last active January 23, 2024 19:08
Add some Content on body footer
$("body").append(
"<a href='https://themeforest.net/checkout/from_item/36367959?license=regular&support=bundle_6month&_ga=2.253043593.1220166448.1645934757-918236941.1644836235' target='_blank' class='buy-now-btn'><img src='assets/images/envato.png' alt='envato'/>Buy Now</a>"
);
$("body").append("<div class='switch-box'><label id='switch' class='switch'><input type='checkbox' onchange='toggleTheme()' id='slider'><span class='slider round'></span></label></div>");
@prosantamazumder
prosantamazumder / .js
Last active January 23, 2024 19:08
Call Js in one js file
document.writeln('<script src="assets/js/bootstrap.bundle.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/meanmenu.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/ajaxchimp.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/form-validator.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/contact-form-script.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/owl.carousel.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/jquery-ui.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/magnific-popup.min.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/aos.js" type="text/javascript"></script>');
document.writeln('<script src="assets/js/tweenMax.min.js" type="text/javascript"></script>');
@prosantamazumder
prosantamazumder / pagination.php
Created September 30, 2023 14:34
WordPress Blog Post Custom Pagination
require_once function.php
<?php
// PAGINATION
function pagination($pages = '', $range = 4){
$showitems = ($range * 2)+1;
global $paged;
if(empty($paged)) $paged = 1;
@prosantamazumder
prosantamazumder / .liquid
Created August 21, 2023 19:43
shopify Product loop with product Json data and display Tags
{%- for product in collections[block.settings.collection].products -%}
{{ product | json }}
{% render 'product-card', product: product, column_wrapper: true %}
{% for tag in product.tags %}
<li><a href="/collections/all/{{ tag | handleize }}">{{ tag }}</a></li>
{% endfor %}
{%- endfor -%}
@prosantamazumder
prosantamazumder / Collection Filtering
Created August 19, 2023 16:02
Collection Filtering
{% comment %} Our basic motive is to breakdown our products in different filters in form of tags.Let your customers search products with "shop by category,shop by size and many more
Replace the given code below in your collection.liquid
{% endcomment %}
<ul class="clearfix filters">
<li class="clearfix filter">
{% assign tags = 'Blue, Grey, Black' | split: ',' %}
<label>Shop by color</label>
<select class="coll-filter">
@prosantamazumder
prosantamazumder / gist:74fe8b09f13324f49c1ab110efc6f4fd
Created August 19, 2023 10:36
Shopify liquid collection loop
{% for collection in collections %}
{% if collection.products_count > 10 %}
<h4>
<a href="{{ collection.url }}">{{ collection.title }}</a>
</h4>
{% endif %}
{% endfor %}
@prosantamazumder
prosantamazumder / single.php
Created April 25, 2022 12:06
Next Previous Post link in WordPress with previous post title / next post title?
<nav id="nav-single">
<?php
$prev_post = get_previous_post();
$id = $prev_post->ID ;
$permalink = get_permalink( $id );
?>
<?php
$next_post = get_next_post();
$nid = $next_post->ID ;
$permalink = get_permalink($nid);
@prosantamazumder
prosantamazumder / function.php
Created April 9, 2022 07:46
The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels.
<?php
add_filter('wp_image_editors', function($editors) {
return ['WP_Image_Editor_GD', 'WP_Image_Editor_Imagick'];
});
<?php
function pressTechBreadcrumbs() {
/* === OPTIONS === */
$text['home'] = 'Home'; // text for the 'Home' link
$text['category'] = 'Archive by Category "%s"'; // text for a category page
$text['search'] = 'Search Results for "%s" Query'; // text for a search results page
$text['tag'] = 'Posts Tagged "%s"'; // text for a tag page
$text['author'] = 'Articles Posted by %s'; // text for an author page