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
$termlists = array(); | |
$terms = get_the_terms( get_the_ID(), 'podcast-tag' ); | |
if ( $terms && is_array( $terms ) ) { | |
foreach ( $terms as $term ) { | |
$termlists[] = $term->slug; | |
} | |
} | |
$query_args = 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
$terms = get_the_terms( get_the_ID(), 'podcast-tag' ); | |
if ( $terms && is_array( $terms ) ) { | |
foreach ( $terms as $term ) { | |
$termlists[] = $term->slug; | |
} | |
} | |
$query_args = array( | |
'post_type' => 'podcast', |
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 | |
/** | |
* Register and load the widget | |
*/ | |
add_action( 'widgets_init', 'topgear_load_widgets' ); | |
function topgear_load_widgets() { | |
register_widget( 'Dream_Car_Calculator_Widget' ); | |
} |
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
/** | |
* Insert LinkUrl to wp_imported_articles table | |
* | |
* @param $LinkUrl | |
* @return int | |
*/ | |
function topgear_save_LinkUrl_todatabase($LinkUrl) | |
{ | |
global $wpdb; |
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
/** | |
* Check post by postmeta | |
* @param $LinkUrl | |
* @return int | |
*/ | |
function topgear_post_exists_by_LinkUrl($LinkUrl) | |
{ | |
global $wpdb; | |
$wpdb->get_results("SELECT ID FROM `{$wpdb->base_prefix}imported_articles` WHERE LinkUrl = '".$LinkUrl."' "); |
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
/** | |
* Create custom table to keep import article url | |
*/ | |
add_action('init', 'topgear_create_import_exists_table'); | |
function topgear_create_import_exists_table() | |
{ | |
global $wpdb; | |
$charset_collate = $wpdb->get_charset_collate(); |
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 topgear_midnight_cron_task() | |
{ | |
$action = isset($_GET['action'])? $_GET['action']: null; | |
if($action !== 'cron'){ return ;} | |
// Find Author | |
$user = get_user_by( 'login', 'Topgear' ); | |
$userID = ($user->ID)? $user->ID : 4; | |
// Find Category |
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
if ( is_plugin_active('sitepress-multilingual-cms/sitepress.php') ) { | |
include_once( WP_PLUGIN_DIR . '/sitepress-multilingual-cms/inc/wpml-api.php' ); | |
$_POST['icl_post_language'] = $language_code = 'en'; // change the language code | |
wpml_add_translatable_content( 'post_my_post_type', $ID, $language_code ); | |
} |
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
$action = isset($_GET['action'])? $_GET['action']: null; | |
if($action !== 'cron'){ return ;} | |
// Find Author | |
$user = get_user_by( 'login', 'Topgear' ); | |
$userID = ($user->ID)? $user->ID : 4; | |
// Find Category | |
$category = get_category_by_slug( 'car-news' ); | |
$categoryID = ($category->term_id)? $category->term_id: null; |
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
<div class="container mt-100"> | |
<h1 class="title text-center mb-40">Featured Guests</h1> | |
<div class="row"> | |
<div class="col-sm-4 col-6"> | |
<div class="item-advisory"> | |
<?php | |
$args = array( | |
'role' => 'featured_guest', | |
'orderby' => 'user_nicename', | |
'order' => 'ASC' |
NewerOlder