Skip to content

Instantly share code, notes, and snippets.

@sudipbd
sudipbd / anyfile.anyext
Created October 2, 2023 18:00
Remove empty lines in sublime text
CTRL+H (Search and Replace)
Search: ^[\s]*?[\n\r]+
**Regular Expression must be on
Replace: with on space
@sudipbd
sudipbd / home.php
Last active October 2, 2023 17:58
Display Title in Wordpress Custom Post
<?php //for custom post?>
<title><?php bloginfo('name'); ?> <?php is_front_page() ? bloginfo('description') : wp_title(''); ?></title>
<?php //for static homepage?>
<title><?php bloginfo('name'); ?> &raquo; <?php is_front_page() ? bloginfo('description') : wp_title(''); ?></title>
@sudipbd
sudipbd / create new page
Created November 5, 2022 17:36
Shortcode to view product categories on woocommerce
[product_categories]
@sudipbd
sudipbd / .htaccess
Created September 14, 2022 06:03
for new websites if welcome message is not shown
DirectoryIndex index.php index.html index.htm
@sudipbd
sudipbd / index.html
Created August 5, 2018 17:07
Using Font Awesome 5 solid icons as pseudo element
<ul>
<li>Get timely updates through conference calls, webcasts and presentations.</li>
<li>Are you a member of the media? Our Newsroom contains our press kit</li>
<li>We develop and grow business leaders.</li>
<li>We always want to keep your home safe and stedy</li>
</ul>
@sudipbd
sudipbd / index.html
Created August 4, 2018 17:22
Bootstrap 4 offsetting
<!-- content start -->
<div class="zigzag2">
<div class="container">
<div class="row justify-content-start">
<div class="col-lg-6">
</div>
</div>
</div>
</div>
@sudipbd
sudipbd / functions.php
Created February 10, 2017 14:38
WordPress change 'post' to something else
function revcon_change_post_label() {
global $menu;
global $submenu;
$menu[5][0] = 'News';
$submenu['edit.php'][5][0] = 'News';
$submenu['edit.php'][10][0] = 'Add News';
$submenu['edit.php'][16][0] = 'News Tags';
}
function revcon_change_post_object() {
global $wp_post_types;
@sudipbd
sudipbd / index.html
Created January 18, 2017 09:05
Image hover effect awnko
<section id="promotion_area" class="promotion_area">
<div class="container">
<div class="row">
<div class="pormos">
<div class="col-md-3 col-sm-6">
<div class="single_promo portfolio">
<img src="img/1.png" alt=""/>
<p>John Doe</p>
<span>Asst. Professor, Cooking</span>
@sudipbd
sudipbd / index.html
Created January 18, 2017 05:01
Simple lightbox for image
<div class="gallery-images">
<div class="col-md-6 col-sm-6 col-xs-6">
<div class="gallery_single active">
<a class="fancybox" rel="group" href="img/gallery1.jpg" title="Image Caption">
<img src="img/gallery1.jpg" alt="gallery image" />
</a>
</div>
</div>
<div class="col-md-2 col-sm-6 col-xs-6">
@sudipbd
sudipbd / functions.php
Created January 11, 2017 05:55
WordPress remove empty <p>
/**
* Remove empty paragraphs created by wpautop()
* @author Ryan Hamilton
* @link https://gist.github.com/Fantikerz/5557617
*/
function remove_empty_p( $content ) {
$content = force_balance_tags( $content );
$content = preg_replace( '#<p>\s*+(<br\s*/*>)?\s*</p>#i', '', $content );
$content = preg_replace( '~\s?<p>(\s|&nbsp;)+</p>\s?~', '', $content );
return $content;