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
/**
* Frontend Theme Functions.
*
* @package magplus
* @subpackage Template
*/
/**
* Theme Loader
* @param string $logo_field
<?php
/**
* Partial template for social share buttons on single page.
*
* See: inc/social-share.php for filters and caller.
*/
$props = array_replace([
'active' => [
'facebook', 'twitter', 'pinterest', 'linkedin', 'tumblr', 'email'
<?php
/**
* Common post footer components.
*/
// Add bottom social share
get_template_part('partials/single/social-share-bot');
// Add next/previous.
get_template_part('partials/single/post-navigation');
<?php
/**
* Partial Template for Single Post "Modern Layout" - called from single.php
*/
$props = array_replace(
[
'layout' => 'modern-a',
'header_outer' => false,
'centered' => false,
'cat_style' => Bunyad::options()->post_meta_single_cat_labels,
@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>