Skip to content

Instantly share code, notes, and snippets.

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

Mahmud Sohag Gazi IamSohaggazi

🏠
Working from home
  • Chandpur, Bangladesh
View GitHub Profile
@IamSohaggazi
IamSohaggazi / wordpress custom post type with icon
Last active June 15, 2019 15:31
if you create post type featured box or service box with supported icon and featured image you can use this below code
/*
* register custom post type <go to function.php >
*/
function neuiro_custom_post_type(){
register_post_type('neuiro_featured',
array(
'labels' => array(
'name' => __('Features'),
'singular_name' => __('feature'),
//** capie Woocommerce Theme Options Panel **//
// show all sale in onepage
$cmb = show_all_shop_items( array(
'id' => 'show_top_items',
'title' => 'Best Sellar Center',
'object_types' => array( 'page' ), // post type
'show_on' => array( 'data_post_say_intro' => 'id', 'value' => array( 50, 24 ) ),
'context' => 'normal', // 'normal', 'advanced', or 'side'
'priority' => 'high', // 'high', 'core', 'default' or 'low'
Root url for website
---------------------------------------------------------
<?php site_url(); ?>
<?php bloginfo('url'); ?>
title of specific post/page
---------------------------------------------------------
<?php wp_title(); ?>
Site Home URL
<?php
/* -----------------------------------------------------------------------------
* Helper Function
* -------------------------------------------------------------------------- */
if ( ! function_exists( 'omc_get_option' ) ) {
/**
* Proxy Function
*/
function omc_get_option( $opt_name, $default = null ) {
header.php - header section
index.php - main section
sidebar.php - sidebar section
footer.php - footer section
single.php - post template
page.php - page template
comments.php - comments template
search.php - search content
searchform.php - search form
archive.php - archive
the_post_thumbnail(); // Without parameter ->; Thumbnail
the_post_thumbnail( 'thumbnail' ); // Thumbnail (default 150px x 150px max)
the_post_thumbnail( 'medium' ); // Medium resolution (default 300px x 300px max)
the_post_thumbnail( 'medium_large' ); // Medium-large resolution (default 768px x no height limit max)
the_post_thumbnail( 'large' ); // Large resolution (default 1024px x 1024px max)
the_post_thumbnail( 'full' ); // Original image resolution (unmodified)
the_post_thumbnail( array( 100, 100 ) ); // Other resolutions (height, width)
add_image_size( 'category-thumb', 300, 9999 ); // 300 pixels wide (and unlimited height)
@raselahmed7
raselahmed7 / google-fonts.php
Last active November 11, 2022 10:22
How to call google fonts from theme option in best way
<?php
$frozen_body_font_get = cs_get_option('frozen_body_font');
$frozen_heading_font_get = cs_get_option('frozen_headding_font');
function frozen_crazycafe_body_gf_url() {
$font_url = '';
$frozen_body_font_get = cs_get_option('frozen_body_font');
if(array_key_exists('family', $frozen_body_font_get)) {
$frozen_body_font_get_family = $frozen_body_font_get['family'];