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
@TanvirAmi
TanvirAmi / youtube_id_regex.php
Created May 17, 2022 10:24 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
<?php get_header(); ?>
<div class="container">
<div class="row">
<div id="content" class="col-md-9">
<?php if ( of_get_option( 'gomedia_featured_posts', '1' ) ) { ?>
<section id="featured-content" class="row clearfix">
@TanvirAmi
TanvirAmi / header.php
Created July 8, 2019 12:48
custom header.php for biancaa
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
@TanvirAmi
TanvirAmi / content-page.php
Created June 20, 2019 04:33
Added publish date for page in beginner theme
<?php
// Get the customizer value.
$title = beginner_mod( PREFIX . 'page-title' );
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php hybrid_attr( 'post' ); ?>>
<?php if ( $title ) : ?>
<?php the_title( '<h1 class="page-title" ' . hybrid_get_attr( 'entry-title' ) . '>', '</h1>' ); ?>
<?php endif; ?>
@TanvirAmi
TanvirAmi / comments.php
Created April 9, 2019 18:46
comment form above the comment list
<?php
/*
* If the current post is protected by a password and
* the visitor has not yet entered the password we will
* return early without loading the comments.
*/
if ( post_password_required() ) {
return;
}
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php hybrid_attr( 'post' ); ?>>
<?php truereview_post_thumbnail(); ?>
<div class="entry-wrapper">
<header class="entry-header">
<?php the_title( sprintf( '<h2 class="entry-title" ' . hybrid_get_attr( 'entry-title' ) . '><a href="%s" rel="bookmark" itemprop="url">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
</header>
<?php
/**
* Grid classic block.
*
* @package TrueReview
* @author Theme Junkie
* @copyright Copyright (c) 2016, Theme Junkie
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @since 1.0.0
*/
<?php
/**
* Modern vertical block.
*
* @package TrueReview
* @author Theme Junkie
* @copyright Copyright (c) 2016, Theme Junkie
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @since 1.0.0
*/
<?php
/**
* Modern block.
*
* @package TrueReview
* @author Theme Junkie
* @copyright Copyright (c) 2016, Theme Junkie
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @since 1.0.0
*/
@TanvirAmi
TanvirAmi / woocommerce.css
Created March 24, 2019 21:30
Latest woocommerce styling for adios
.woocommerce del,
.woocommerce-page del {
color: #abaeaf;
}
.woocommerce ins,
.woocommerce-page ins {
color: #272b2b;
text-decoration: none;
}