Skip to content

Instantly share code, notes, and snippets.

View prosantamazumder's full-sized avatar

Prosanta Mazumder prosantamazumder

View GitHub Profile
wp_nav_menu( array $args = array(
'menu' => "", // (int|string|WP_Term) Desired menu. Accepts a menu ID, slug, name, or object.
'menu_class' => "", // (string) CSS class to use for the ul element which forms the menu. Default 'menu'.
'menu_id' => "", // (string) The ID that is applied to the ul element which forms the menu. Default is the menu slug, incremented.
'container' => "", // (string) Whether to wrap the ul, and what to wrap it with. Default 'div'.
'container_class' => "", // (string) Class that is applied to the container. Default 'menu-{menu slug}-container'.
'container_id' => "", // (string) The ID that is applied to the container.
'fallback_cb' => "", // (callable|bool) If the menu doesn't exists, a callback function will fire. Default is 'wp_page_menu'. Set to false for no fallback.
'before' => "", // (string) Text before the link markup.
@prosantamazumder
prosantamazumder / footer.php
Created July 25, 2020 17:13
How to add BACKGROUND MUSIC to WordPress website - ( works on phone) 2020.
register_taxonomy('projects_cat', 'projects', array(
'labels' => array(
'name' => 'Category',
'add_new_item' => 'Add New Category',
'parent_item' => 'Parent Category',
),
'public' => true,
'hierarchical' => true
));
/**
* 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 {
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
*
// 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' );
//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>
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",
@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 );
<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="">