This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Timer Element Elementor | |
* Plugin URI: | |
* Description: | |
* Version: 1.0 | |
* Author: MD Tanjim | |
* License: GPLv2 or later | |
* Text Domain: timerelement | |
* Domain Path: /languages/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function t_process_section_type($part){ | |
global $post; | |
if('section'== $post->post_type ){ | |
$section_type = get_post_meta($post->ID, 't_section_type', true); | |
$sections = array('banner','testimonial','service','newsletter','skill'); | |
foreach($sections as $section){ | |
if("section-{$section}.php"== $part['part'] && $section != $section_type){ | |
return false; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
global $post; | |
$args = array( 'posts_per_page' => -1, 'post_type'=> 'posttype', 'orderby' => 'menu_order', 'order' => 'ASC' ); | |
$myposts = get_posts( $args ); | |
foreach( $myposts as $post ) : setup_postdata($post); ?> | |
<?php | |
$job_link= get_post_meta($post->ID, 'job_instructions', true); | |
?> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$philosophy_fp = new WP_Query( | |
array( | |
'meta_key' => 'featured', | |
'meta_value'=> '1', | |
'posts_per_page'=> 3 | |
) | |
); | |
$post_data = array(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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")); | |
} |
NewerOlder