Skip to content

Instantly share code, notes, and snippets.

View TanvirAmi's full-sized avatar
🏠
Working from home

Tanvir TanvirAmi

🏠
Working from home
View GitHub Profile
<?php
/**
* http://webdeveloperswall.com/php/get-youtube-video-id-from-url
**/
function extractUTubeVidId($url){
/*
* type1: http://www.youtube.com/watch?v=9Jr6OtgiOIw
* type2: http://www.youtube.com/watch?v=9Jr6OtgiOIw&feature=related
* type3: http://youtu.be/9Jr6OtgiOIw
*/
@TanvirAmi
TanvirAmi / WP_Latest_Posts_Widget.class.php
Created August 16, 2018 12:00
Custom popular post widget(MagPlus)
<?php
/**
* Latest posts widget
*
* @package magplus
*/
class magplus_WP_Latest_Posts_Widget extends WP_Widget
{
function __construct()
{
@TanvirAmi
TanvirAmi / map.php
Created June 8, 2018 09:04
../wp-content/plugins/adios-addons/composer/map.php
<?php
/*
* Visual Composre Map File
*/
function rs_get_current_post_type() {
$type = false;
if( isset( $_GET['post'] ) ) {
$id = $_GET['post'];
<?php
/**
* Slider Style 2
*
* @package magplus
* @since 1.0
*/
?>
<?php
#stop directory browsing
Options All -Indexes
# SSL Https active Force non-www
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);
@TanvirAmi
TanvirAmi / functions.php
Created April 25, 2018 10:30 — forked from thejamescollins/functions.php
Display product description on WooCommerce shop/category pages
<?php
/**
* Add the product's short description (excerpt) to the WooCommerce shop/category pages. The description displays after the product's name, but before the product's price.
*
* Ref: https://gist.github.com/om4james/9883140
*
* Put this snippet into a child theme's functions.php file
*/
function woocommerce_after_shop_loop_item_title_short_description() {
global $product;
@TanvirAmi
TanvirAmi / gist:41f658e480f41089e85b739d78e642ae
Created April 10, 2018 18:24 — forked from francoishill/gist:6483997
Media queries for mobile devices - Requires at least requires the meta viewport tag with content 'width=device-width'
/*http://i-skool.co.uk/mobile-development/web-design-for-mobiles-and-tablets-viewport-sizes/*/
/*At least requires the meta viewport tag with content 'width=device-width'*/
@media only screen and (max-width: 1080px) and (orientation : portrait) {
/* PORTRAIT:
Windows Surface Pro*/
}
@media only screen and (max-width: 800px) and (orientation : portrait) {
/* PORTRAIT:
Acer Iconia Tab A100
//Featured post child function
function rexus_featured_posts() {
global $post;
$enable = of_get_option( 'rexus_enable_featured', '1' ); // Enable disable area.
$tag = of_get_option( 'rexus_featured_tag' ); // Get the user selected tag for the featured posts.
// Bail if disable by user.
if ( ! $enable ) {
return;
@TanvirAmi
TanvirAmi / 1. main.css
Created March 20, 2018 04:48 — forked from EmranAhmed/1. main.css
CSS Responsive breakpoint, Media Query break point
/*==================================================
= Bootstrap 3 Media Queries =
==================================================*/
/*========== Mobile First Method ==========*/
/* Custom, iPhone Retina */
@media only screen and (min-width : 320px) {
}