Skip to content

Instantly share code, notes, and snippets.

@sudipbd
sudipbd / functions.php
Created November 25, 2016 16:51
WordPress additional class to first div, li
jQuery(document).ready(function(){
jQuery("ol.carousel-indicators li:first-child").addClass("active");
});
@sudipbd
sudipbd / functions.php
Created November 26, 2016 07:12
WordPress registering a sidebar
<?php
function desh_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'twentysixteen' ),
'id' => 'blogroll',
'description' => __( 'Add widgets here to appear in your sidebar.', 'twentysixteen' ),
'before_widget' => '<div id="%1$s" class="widget %2$s">',
'after_widget' => '</div>',
'before_title' => '<h5>',
'after_title' => '</h5>',
@sudipbd
sudipbd / index.php
Created November 30, 2016 05:48
WordPress comments template
<?php comments_template( '', true ); ?>
@sudipbd
sudipbd / style.css
Created December 1, 2016 05:05
WordPress default styles
/* wordpress default */
img.alignright {float:right; margin:0 0 1em 1em}
img.alignleft {float:left; margin:0 1em 1em 0}
img.aligncenter {display: block; margin-left: auto; margin-right: auto}
a img.alignright {float:right; margin:0 0 1em 1em}
a img.alignleft {float:left; margin:0 1em 1em 0}
a img.aligncenter {display: block; margin-left: auto; margin-right: auto}
em{font-style: italic;}
@sudipbd
sudipbd / style.css
Last active December 1, 2016 08:06
WordPress comments CSS
ol.commentlist{
margin: 10px 5px;
padding: 10px;
}
.commentlist .comment-body{
padding: 10px;
background: #EFEFEF;
border: solid thin #DEDEDE;
margin: 10px 0;
position: relative;
@sudipbd
sudipbd / .htaccess
Created December 3, 2016 04:35
WordPress Fatal Error
php_value max_execution_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 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 / 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 / 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;
}