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 get_header(); ?>
<div id="content">
<?php get_template_part('includes/breadcrumbs'); ?>
<div class="archive-child">
<?php
$x = get_category( get_query_var( 'cat' ) );
$y = $x->cat_ID;
<div class="two-column-boxes">
<?php
if (get_option('newswire_twocol_cats') <> '') $exclude_twocol_cats = implode(",", get_option('newswire_twocol_cats'));
$args = "orderby=".get_option('newswire_sort_cat');
if ( isset( $exclude_twocol_cats ) ) $args .= "&exclude=".$exclude_twocol_cats;
$categories = get_categories($args);
<?php
/**
* Random Posts with Thumbnail widget.
*
* @package SiteBox
* @author Theme Junkie
* @copyright Copyright (c) 2015, Theme Junkie
* @license http://www.gnu.org/licenses/gpl-2.0.html
* @since 1.0.0
*/
<?php
/*
* Returns post IDs in a term with a given ID
*
* @param int $term_id(Category ID, Tag ID)
*
* @return array|int Post ID(s)
*/
function get_post_id_by_term_id( $term_id ){
global $wpdb;
<?php
/**
* Theme Customizer
* @package OOF Theme
*/
function oof_customizer_register(){
// Stores all the controls that will be added
$options = array();
<div class="classic">
<article id="post-<?php the_ID(); ?>" <?php post_class( 'clearfix' ); ?> <?php hybrid_attr( 'post' ); ?>>
<?php if ( has_post_thumbnail() ) : ?>
<div class="classic-thumbnail" itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'supernews-classic', array( 'class' => 'entry-thumbnail', 'alt' => esc_attr( get_the_title() ) ) ); ?></a>
<?php
// Get the image attributes
$attr = wp_get_attachment_image_src( get_post_thumbnail_id(), 'supernews-classic' );
?>
<li class="buff"><a href="https://bufferapp.com/add?url='<?php echo urlencode( get_permalink( get_the_ID() ) ); ?>&amp;title=<?php echo urlencode( esc_attr( get_the_title( get_the_ID() ) ) ); ?>" target="_blank"><span class="buffer"></span><span>Buffer</span></a></li>
<li class="whatsapp"><a href="whatsapp://send?text=<?php echo urlencode( get_permalink( get_the_ID() ) ); ?>&amp;title=<?php echo urlencode( esc_attr( get_the_title( get_the_ID() ) ) ); ?>" target="_blank"><i class="fa fa-whatsapp"></i></a></li>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php hybrid_attr( 'post' ); ?>>
<?php
if ( has_post_format( 'image' ) )
beginner_get_first_image( 'large' );
?>
<?php
if ( has_post_format( 'link' ) ) {
beginner_get_post_format_link_url();
<article id="post-<?php the_ID(); ?>" <?php post_class( 'archive' ); ?>>
<?php the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
<span class="entry-author vcard">
<?php printf( esc_html__( 'by %s', 'featured' ), '<a class="url fn n" href="' . esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) . '">' . esc_html( get_the_author() ) . '</a>' ); ?>
</span>
<div class="post-thumbnail thumbnail">
<?php featured_archive_thumbnail(); ?>
<?php
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and