Skip to content

Instantly share code, notes, and snippets.

View prosantamazumder's full-sized avatar

Prosanta Mazumder prosantamazumder

View GitHub Profile
/****************Customizing Woocommerce Checkout Page with CSS***************/
.woocommerce form .form-row {
width: 100% !important;
}
.woocommerce-checkout #payment div.payment_box input.input-text, .woocommerce-checkout #payment div.payment_box textarea {
width: 100% !important;
padding: 8px;
}
.woocommerce #payment .form-row select, .woocommerce-page #payment .form-row select {
width: 100%;
@prosantamazumder
prosantamazumder / function.php
Created May 7, 2021 18:11
Proper way to enqueue scripts and styles in wordpress
/**
* Proper way to enqueue scripts and styles
*/
function wpdocs_theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );
<div class="blog-list-area">
<div class="container">
<?php
$custom_terms = get_terms(
'portfolio_cat',
array(
'orderby' => 'name',
'order' => 'DESC',
'hide_empty' => 1,
<?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
@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'];
});
@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 / 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 / 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 / .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 / 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;