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 | |
// Add a custom column to product category admin page | |
function custom_product_category_image_column($columns) { | |
$columns['category_image'] = 'Image'; | |
$columns['category_color'] = 'Color'; | |
return $columns; | |
} | |
add_filter('manage_edit-product_category_columns', 'custom_product_category_image_column'); | |
// Display the ACF image in the custom column |
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="movie"> | |
<div class="movie__video"> | |
<div class="movie__video__item"> | |
<!-- !!! READ IMPORTANT !!! --> | |
<!-- Replace the id of the video only.. -> ../embed/ID" --> | |
<iframe class="youtube-video" width="560" height="315" src="https://www.youtube.com/embed/6FEsFvZ-hqY?enablejsapi=1&version=3&playerapiid=ytplayer&controls=0" modestbranding="0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | |
</div> | |
<div class="movie__video__btn"> | |
<a href="#" class="btn btn-video">play movie</a> | |
</div> |
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 | |
/** | |
* Page type | |
* Returns the page type : parent, child or normal | |
* parent -> have child pages | |
* child -> have parent pages | |
* normal -> have no parent and no child | |
*/ | |
function get_tkef_page_type(){ |
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 | |
// Go one directory up from the directory of the current PHP file | |
$dir = dirname(__DIR__); | |
$folders = scandir($dir); // Get all folders and files | |
// Filter only directories | |
$directories = array_filter($folders, function($folder) use ($dir) { | |
return is_dir($dir . DIRECTORY_SEPARATOR . $folder) && $folder != "." && $folder != ".."; |
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 | |
// $reversePosts = array_reverse($hashtagTopMedia["data"]); | |
$instaData = get_option('insta_json_data'); | |
if($instaData){ | |
$reversePosts = json_decode($instaData, true); | |
foreach( $reversePosts as $k=>$h ) { | |
if($h['media_type'] == "CAROUSEL_ALBUM"){ | |
foreach( $h["children"]["data"] as $key => $media ) { | |
if ( $h["children"]["data"][$key]["media_type"] === 'IMAGE' ) { | |
$img_url = $h["children"]["data"][$key]["media_url"]; |
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 | |
function ajax_pagination($news, $paged, $count){ | |
if($news->found_posts > $count) { | |
/** Stop execution if there's only 1 page */ | |
if( $news->max_num_pages <= 1 ) | |
return; | |
// $paged = get_query_var( 'paged' ) ? absint( get_query_var( 'paged' ) ) : 1; | |
$max = intval( $news->max_num_pages ); |
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 | |
// Remove ACF inline styles for WYSIWYG | |
function my_acf_input_admin_footer() { | |
if( get_post_type() == "jobs" ) { ?> | |
<script type="text/javascript"> | |
(function($) { | |
acf.add_action('wysiwyg_tinymce_init', function( ed, id, mceInit, $field ){ | |
$(".acf-field .acf-editor-wrap iframe").removeAttr("style"); | |
}); | |
})(jQuery); |
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 | |
// Linking CSS and Javascripts required for pages | |
function project_script_enqueue() { | |
wp_enqueue_style( 'project-google-fonts', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Noto+Sans+JP:wght@400;500;700&display=swap',array(), null ); | |
wp_enqueue_style('main_style', get_stylesheet_directory_uri() . '/assets/css/app.css',array(), filemtime( get_stylesheet_directory() . '/assets/css/app.css')); | |
wp_enqueue_style('support_wp_style', get_stylesheet_directory_uri() . '/style.css',array(), filemtime( get_stylesheet_directory() . '/style.css')); | |
wp_register_script( 'ajax-product', get_stylesheet_directory_uri() . '/assets/js/ajax-product.js', array( 'jquery' ), filemtime( get_stylesheet_directory() . '/assets/js/ajax-product.js'), true ); | |
wp_localize_script( 'ajax-product', 'ajax_product_params', array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) ); | |
wp_enqueue_script( 'ajax-product' ); |
NewerOlder