Skip to content

Instantly share code, notes, and snippets.

View prosantamazumder's full-sized avatar

Prosanta Mazumder prosantamazumder

View GitHub Profile
<div class="blog-list-area">
<div class="container">
<?php
$custom_terms = get_terms(
'portfolio_cat',
array(
'orderby' => 'name',
'order' => 'DESC',
'hide_empty' => 1,
@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' );
/****************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%;
<meta charset="UTF-8">
<meta name="keywords" content="your, tags">
<meta name="description" content="150 words">
<meta name="subject" content="your website"s subject">
<meta name="copyright" content="company name">
<meta name="language" content="ES">
<meta name="robots" content="index,follow">
<meta name="revised" content="Sunday, July 18th, 2010, 5:15 pm">
<meta name="abstract" content="">
<meta name="topic" content="">
@prosantamazumder
prosantamazumder / wp-config.php
Created April 17, 2021 21:26
How to Remove <p> and <br /> from Contact Form 7
Are you looking for a way to remove all of the extra <p> and <br /> from your forms? Contact form 7 is a great tool but sometimes it adds a little extra HTML that you might want to get rid off within your pages and posts. We have created a quick code snippet that you can use to remove <p> and <br /> from Contact Form 7.
Instructions:
All you have to do is add this code to your wp-config.php file:
define('WPCF7_AUTOP', false );
The code
<?php
function box_repeater_items_funct() {
vc_map(
array(
"name" => __("Box Repeater", "my-text-domain"), // Element name
"base" => "box_repeater", // Element shortcode
"class" => "box-repeater",
//Main functions codex.wordpress.org
wp_trim_words( string $text, int $num_words = 55, string $more = null );
//Variable
$text = get_the_content();
$num_words = 12;
$more = '<a class="className" href="'.get_permalink( get_the_ID() ).'"> Read More</a>';
//Apply HTML OR Diplay front-end
<p><?php echo wp_trim_words( $text, $num_words, $more ); ?></p>
// Google Font Function
/**
//Using a single key and value:
<add_query_arg( 'key', 'value', 'http://example.com' );
//Using an associative array:
add_query_arg( array(
'key1' => 'value1',
'key2' => 'value2',
), 'http://example.com' );
Files Name: elementor-disable-all-wp-widgets.php
<?php
/**
* Disable elementor registered widget.
*
* This will disable all WordPress native widgets
*
* @param \Elementor\Widgets_Manager $widgets_manager Instance of elementor widgets manager
*
/**
* Post to news
Changes the default WordPress post name to News and replace the Dashicon.
*
* @since 1.0.0
* @access public
*/
class Posts_To_News {