Skip to content

Instantly share code, notes, and snippets.

View tanjimahmmed's full-sized avatar
🎯
Focusing

Md Tanjim Ahmmed tanjimahmmed

🎯
Focusing
View GitHub Profile
@tanjimahmmed
tanjimahmmed / counter option
Created December 13, 2019 14:16
Counter option
// -- counter -- //
$(".counter_number span").counterUp({
delay : 10,
time : 1000,
});
@tanjimahmmed
tanjimahmmed / Modal Video Option
Created December 13, 2019 14:26
Modal Video Option
// -- modal video -- //
$(".play_icon").modalVideo();
$(".play_icon").on('click', function(){
return false;
});
@tanjimahmmed
tanjimahmmed / wp stylesheet
Created February 22, 2020 06:53
stylesheet
wp comment must :
====================================
/*
Theme Name: Philosophy
Theme URI:
AUTHOR: MD Tanjim Ahmmed
AUTHOR URI: https://tanjimahmmed.github.io/tanjim-portfolio/
Description: Philosophy by colorlib
Version: 1.0
License: GNU General Public License v2 or later
@tanjimahmmed
tanjimahmmed / function.php
Last active February 26, 2020 01:46
theme support
<?php
require_once(get_theme_file_path("/inc/tgm.php"));
require_once(get_theme_file_path("/inc/attachments.php"));
if (site_url()=="http://127.0.0.1/demo.tanjim.com"){
define("VERSION", time());
}else{
define("VERSION",wp_get_theme()->get("version"));
}
@tanjimahmmed
tanjimahmmed / featured.php
Created February 22, 2020 18:26
featured area
@tanjimahmmed
tanjimahmmed / navigation.php
Last active February 23, 2020 16:44
navigation area
<a class="header__toggle-menu" href="#0" title="Menu"><span>
<?php _e("Menu", 'philosophy'); ?></span>
</a>
<nav class="header__nav-wrap">
<h2 class="header__nav-heading h6">
<?php _e('Site Navigation', 'philosophy') ?>
</h2>
@tanjimahmmed
tanjimahmmed / attachments.php
Last active February 24, 2020 15:04
attachments plugin method add
<?php
define('ATTACHMENTS_SETTINGS_SCREEN', false);
add_filter('attachments_default_instance', '__return_false');
// field area
function philosophy_attachments($attachments){
// if else
$post_id = null;
if( isset( $_REQUEST['post']) || isset( $_REQUEST['post_ID'] ) ){
$post_id = empty($_REQUEST['post_ID']) ? $_REQUEST['post'] : $_REQUEST['post_ID'];
@tanjimahmmed
tanjimahmmed / user social link
Created February 24, 2020 17:45
for user social link
@tanjimahmmed
tanjimahmmed / slug
Last active February 28, 2020 17:22
slug link change
function philosophy_cpt_slug_fix($post_link, $id){
$p = get_post($id);
if(is_object($p) && 'chapter'==get_post_type($id)){
$parent_post_id = get_field('parent_book');
$parent_post = get_post($parent_post_id);
if($parent_post){
$post_link = str_replace("%book%", $parent_post->post_name,$post_link);
}
}
return $post_link;
@tanjimahmmed
tanjimahmmed / Register custom post type
Created March 2, 2020 05:01
Register custom post
add_action( 'init', 'my_theme_custom_post' );
function my_theme_custom_post() {
register_post_type( 'cpt',
array(
'labels' => array(
'name' => __( 'CPTs' ),
'singular_name' => __( 'CPT' )
),
'supports' => array('title', 'editor', 'custom-fields', 'thumbnail', 'page-attributes'),
'public' => true