Skip to content

Instantly share code, notes, and snippets.

View milapdave's full-sized avatar

Milap Dave milapdave

View GitHub Profile
<?php
/**
* Short custom post type
*/
function my_theme_custom_post() {
register_post_type( 'cpt',
array(
'labels' => array(
@milapdave
milapdave / custom_logo.php
Created November 11, 2022 10:35 — forked from humayunahmed8/custom_logo.php
WP Custom Logo
<?php
<div class="logo">
<a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php $logo_id = get_theme_mod('custom_logo'); ?>
<?php if(!empty($logo_id)) : the_custom_logo(); else : ?>
<h3><?php bloginfo( 'name' ); ?></h3>
<?php endif; ?>
@milapdave
milapdave / 1-wp_nav_menu.php
Created November 11, 2022 10:35 — forked from humayunahmed8/1-wp_nav_menu.php
WP Navigation Menus
<?php
// Display Menus on Theme
wp_nav_menu(
array(
'theme_location' => 'header-menu',
'container' => 'div',
'container_class' => 'navbar-collapse collapse align-left',
'menu_class' => 'nav navbar-nav',
@milapdave
milapdave / register-sidbar.php
Created November 11, 2022 10:35 — forked from humayunahmed8/register-sidbar.php
Register sidebar
<?php
/**
* Register widget area.
*
* @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
*/
function stock_humayunbd_widgets_init() {
register_sidebar( array(
if ( ! function_exists( 'prefix_fonts_url' ) ) :
/**
* Register Google fonts.
*
* @return string Google fonts URL for the theme.
*/
function prefix_fonts_url() {
$fonts_url = '';
$fonts = array();
$subsets = '';
@milapdave
milapdave / wp-comment-form-style.css
Created November 11, 2022 10:26 — forked from humayunahmed8/wp-comment-form-style.css
Comment form template CSS for WordPress
/*=====================================
Comment Template CSS
========================================*/
.comments-area {
margin-top: 40px;
}
.comments-area h2.comments-title {
font-size: 25px;
@milapdave
milapdave / widget-css-for-wp.css
Created November 11, 2022 10:26 — forked from humayunahmed8/widget-css-for-wp.css
Widget CSS for WordPress
/*=====================================
Widget CSS
=======================================*/
.widget-area ul {
list-style: none;
margin: 0;
padding: 0;
}
@milapdave
milapdave / 404.php
Last active November 11, 2022 10:38 — forked from humayunahmed8/404.php
Styled 404 error page example
<?php
/**
* The template for displaying 404 pages (not found)
*
* @link https://codex.wordpress.org/Creating_an_Error_404_Page
*
* @package WordPress
* @subpackage MY_Theme
* @since 1.0
* @version 1.0
@milapdave
milapdave / google-fonts.php
Created November 11, 2022 10:22 — forked from raselahmed7/google-fonts.php
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'];
@milapdave
milapdave / wordpress-template-hierarchy.php
Created October 3, 2022 05:36 — forked from humayunahmed8/wordpress-template-hierarchy.php
WordPress Template Hierarchy (as of WordPress 4.9)
<?php
/*
WordPress Template Hierarchy (as of WordPress 4.9)
is_404() -------------------------------------------------------------------------------------------------> 404.php
is_search() ----------------------------------------------------------------------------------------------> search.php
is_front_page() ------------------------------------------------------------------------------------------> front-page.php
is_home() ------------------------------------------------------------------------------------------------> home.php