Skip to content

Instantly share code, notes, and snippets.

View AnkanSoul's full-sized avatar

Ankan Chakraborty AnkanSoul

  • IGI
  • Durgapur
View GitHub Profile
@AnkanSoul
AnkanSoul / Woocommerce Activation
Created April 25, 2018 15:33
Woocommerce Activation
================page.php rename by woocommerce.php============
<?php
if ( have_posts() ) :
woocommerce_content();
endif;
?>
@AnkanSoul
AnkanSoul / Redux Frame Work
Created April 25, 2018 15:31
Redux Frame Work / Add it to function.php
====================================== Redux Frame Work ====================================================
//Redux Frame Work
if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname( __FILE__ ) . '/theme-options/ReduxCore/framework.php' ) ) {
require_once( dirname( __FILE__ ) . '/theme-options/ReduxCore/framework.php' );
}
if ( !isset( $sante ) && file_exists( dirname( __FILE__ ) . '/theme-options/core/theme_option.php' ) ) {
require_once( dirname( __FILE__ ) . '/theme-options/core/theme_option.php' );
}
=============================================================================================
@AnkanSoul
AnkanSoul / Post Call Via Categories
Created April 25, 2018 15:30
Post Call Via Categories
================================================= Post Call Via Categories =============================
<?php
$args=array('post_type' => 'post') ;
$the_qyery= new WP_Query( array( 'category_name' => 'comments-blog') );
if ($the_qyery->have_posts()) :
while ( $the_qyery->have_posts() ) : $the_qyery->the_post();?>
<?php the_permalink() ; ?>
<?php the_title() ; ?>
@AnkanSoul
AnkanSoul / Cart icon
Last active April 25, 2018 15:34
Cart icon
=========================== Cart icon ===================
<?php if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
$count = WC()->cart->cart_contents_count;
?><a class="cart-contents" href="<?php echo WC()->cart->get_cart_url(); ?>" title="<?php _e( 'View your shopping cart' ); ?>"><?php
if ( $count > 0 ) {
?>
<span class="cart-contents-count"><?php echo esc_html( $count ); ?></span>
<?php
}
@AnkanSoul
AnkanSoul / Navigation
Created April 25, 2018 15:29
Navigation
========================== Navigation ==========================================
<?php wp_nav_menu( array( 'theme_location' => 'menu-1', 'menu_id' => 'primary-menu' ) ); ?>
@AnkanSoul
AnkanSoul / CPT Images file call
Created April 25, 2018 15:28
CPT Images file call
=================== CPT Images file call ========================================================
<div class="cs-media">
<?php
$image_src = '';
$image = get_post_meta( $post->ID, 'image_name', true );
$image_src = wp_get_attachment_url( $image );
?>
<figure><img src="<?php echo $image_src; ?>"></figure>
</div>
@AnkanSoul
AnkanSoul / Call Widget
Created April 25, 2018 15:28
Call Widget
============================== Call Widget ======================================================
<?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
<?php dynamic_sidebar( 'sidebar-2' ); ?>
<?php endif; ?>
@AnkanSoul
AnkanSoul / ACF activation keys
Created April 25, 2018 15:27
ACF activation keys
=============== ACF activation keys =============================================================
ACF activation keys -> b3JkZXJfaWQ9OTg5NzN8dHlwZT1kZXZlbG9wZXJ8ZGF0ZT0yMDE3LTAyLTA2IDEwOjUwOjAw
@AnkanSoul
AnkanSoul / blog-material
Last active April 25, 2018 15:32
Blog Material
<?php
$args=array('post_type' => 'service','posts_per_page'=>6,'order' => 'ASC',) ;
$the_qyery= new WP_Query($args);
if ($the_qyery->have_posts()) :
while ( $the_qyery->have_posts() ) : $the_qyery->the_post();?>
<?php echo get_template_directory_uri(); ?>/
<?php echo get_home_url(); ?>/
<?php echo site_url(); ?>/
@AnkanSoul
AnkanSoul / register_custom_post_type
Last active January 23, 2019 05:37
Register Custom Post Type
// Register Custom Post Type
function slider() {
$labels = array(
'name' => _x( 'Post Types', 'Post Type General Name', 'Post Types' ),
'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'Post Types' ),
'menu_name' => __( 'Post Types', 'Post Types' ),
'name_admin_bar' => __( 'Post Type', 'Post Types' ),
'archives' => __( 'Item Archives', 'Post Types' ),
'parent_item_colon' => __( 'Parent Item:', 'Post Types' ),
'all_items' => __( 'All Items', 'Post Types' ),