Skip to content

Instantly share code, notes, and snippets.

View prosantamazumder's full-sized avatar

Prosanta Mazumder prosantamazumder

View GitHub Profile
register_taxonomy('projects_cat', 'projects', array(
'labels' => array(
'name' => 'Category',
'add_new_item' => 'Add New Category',
'parent_item' => 'Parent Category',
),
'public' => true,
'hierarchical' => true
));
@prosantamazumder
prosantamazumder / footer.php
Created July 25, 2020 17:13
How to add BACKGROUND MUSIC to WordPress website - ( works on phone) 2020.
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.
NO NEED
wp-content\themes\veera\framework\classes\class-admin.php
-------------------------------------------------------
<li class="filter active" data-filter="all">Show All</li>
<?php
$topics = get_terms( array(
'hide_empty' => 0,
'taxonomy' => 'portfolio_cat',
'orderby' => 'id',
@prosantamazumder
prosantamazumder / Custom Comments Template.php
Created May 2, 2020 22:05
WordPress Custom Comments Template
<?php
$default_avatar = 'http://zacvineyard.com/blog/wp-content/themes/zac/images/default-avatar.png';
?>
<a id="comments"></a>
<h2>Comments</h2>
<?php if($comments) : ?>
<ol class="comments">
<?php foreach($comments as $comment) : ?>
<li id="comment-<?php comment_ID(); ?>" class="<?php if ($comment->user_id == 1) echo "authcomment";?>">
<?php if ($comment->comment_approved == '0') : ?>
@prosantamazumder
prosantamazumder / RegisterSidebar.m
Last active April 27, 2020 21:11
Register Sidebar / Widgets
//Code added Function.php
function wpb_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Sidebar', 'wpb' ),
'id' => 'sidebar-1',
'description' => __( 'The main sidebar appears on the right on each page except the blog page', 'wpb' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
@prosantamazumder
prosantamazumder / Display-wordpress-category-default-post-.php
Created April 19, 2020 08:38
WordPress Display Custom Post Category in single page.php
<div class="sidebar-tags">
<?php
$categories = get_the_category( $post->ID );
foreach ( $categories as $category ):
?>
<a href="<?php echo esc_url( get_category_link( $category->term_id ) ); ?>"><?php echo esc_html( $category->name ); ?></a>';
<?php endforeach; ?>
</div>
@prosantamazumder
prosantamazumder / Display-wordpress-popular-tags.php
Created April 19, 2020 08:29
WordPress Display Custom Post Tags in single page.php
@prosantamazumder
prosantamazumder / wordpress-post-next-previous-link.php
Created April 19, 2020 08:25
WordPress Get Next Post and Previous Post Link
<div class="col-sm-12">
<div class="theme-pagination">
<ul class="list-inline text-center">
<?php // if need post next previous
$prev_post = get_previous_post();
$id = $prev_post->ID ;
$permalink = get_permalink( $id );
?>
<?php
@prosantamazumder
prosantamazumder / Standard Contact.m
Last active April 12, 2020 19:40
student Admission From
<div class="row">
<div class="col-lg-12">
<div class="row form">
<div class="col-lg-12 form-head">
<h3>PERSONAL &amp; CONTACT INFORMATION</h3>
</div>
<div class="col-lg-12 col-sm-12">
[text* student_name class:form-control placeholder "Student Name*"]
</div>
<div class="col-lg-6 col-sm-6">