Skip to content

Instantly share code, notes, and snippets.

@sudipbd
sudipbd / functions.php
Last active January 9, 2017 09:26
WordPress custom posts links to author archives
/* Add CPTs to author archives */
function custom_post_author_archive($query) {
if ($query->is_author)
$query->set( 'post_type', array('custom_type', 'post') );
remove_action( 'pre_get_posts', 'custom_post_author_archive' );
}
add_action('pre_get_posts', 'custom_post_author_archive');
@sudipbd
sudipbd / index.html
Last active January 8, 2017 05:04
Portfolio using MixItUp
<div class="portfolio-section">
<div class="container">
<div class="row">
<div class="col-md-12">
<div id="mixit_up_masonery_area" class="mixit_up_masonery_area">
<div class="wrapper solve">
<div class="ac_mixitup">
<div class="portfolio">
<div class="portfolio_filter">
<ul>
@sudipbd
sudipbd / index.php
Created December 29, 2016 05:38
WordPress loop with woocommerce product category
<div class="promo_area">
<?php
global $post;
$args = array( 'posts_per_page' => 6, 'post_type'=> 'product', 'order' => 'DESC', 'product_cat' => 'promo', );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<div class="col-md-4 col-sm-6 col-xs-12">
<div class="promo_single">
<div class="grid">
<figure class="promo_offers">
@sudipbd
sudipbd / index.html
Created December 28, 2016 06:12
Parallax Background
<div class="parallax"></div
@sudipbd
sudipbd / functions.php
Created December 28, 2016 06:00
WordPress Author Bio
//fb and tw for author
function my_new_contactmethods( $contactmethods ) {
// Add Twitter
$contactmethods['twitter'] = 'Twitter';
//add Facebook
$contactmethods['facebook'] = 'Facebook';
return $contactmethods;
@sudipbd
sudipbd / style.css
Created December 22, 2016 09:44
SlickNAV Menu to overlap contents
.slicknav_menu {
display: block;
position: absolute;
z-index: 10;
top: 0;
left: 0;
right: 0;
background: #fff;
}
@sudipbd
sudipbd / functions.php
Created December 12, 2016 07:25
WordPress excerpt length
function new_excerpt_length($length) {
return 90;
}
add_filter('excerpt_length', 'new_excerpt_length');
@sudipbd
sudipbd / .htaccess
Created December 10, 2016 06:35
WordPress upload file size limit increase
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
@sudipbd
sudipbd / single.php
Created December 6, 2016 05:40
WordPress show date function
<?php echo get_the_date('M j, Y'); ?>
@sudipbd
sudipbd / .htaccess
Created December 3, 2016 04:35
WordPress Fatal Error
php_value max_execution_time 300