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 pager_loop_function() { | |
ob_start(); | |
$paged1 = isset( $_GET['paged1'] ) ? (int) $_GET['paged1'] : 1; | |
$args1 = array( | |
'post_type' => 'post', | |
'paged' => $paged1, | |
'posts_per_page' => 6, | |
); |
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 get_featured_image_func() { | |
$postid = url_to_postid( $_SERVER['HTTP_REFERER'] ); | |
$image = get_field('featured_image', $postid); | |
$image = '<img src="'.$image["url"].'" />'; | |
return $image; | |
} | |
add_shortcode( 'get_featured_image_shortcode', 'get_featured_image_func' ); |
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 | |
//resource_home_filter_function | |
function resource_home_filter_function() { | |
ob_start(); | |
?> | |
<form method="get" action="/resources/" class="home_filter_form nobottommargin"> | |
<div class="select_filter"> | |
<select name='fwp_product_category' id='fwp_product_category' class='distributor_market' > | |
<option value='' selected='selected'>Document Categories</option> | |
<?php |
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 | |
//Product_home_filter_function | |
function product_home_filter_function() { | |
ob_start(); | |
//Get category outside loop | |
$terms = get_terms( 'product_category' ); | |
$select_categories = ''; | |
$script_product1 = ''; | |
$script_product2 = ''; |
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
<script async defer | |
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB72d431DELv-7l45MlWBDBJH6XxPieMGU"> | |
</script> | |
<script> | |
function initMapHCM() { | |
var center = new google.maps.LatLng(10.793270, 106.687616); | |
var map = new google.maps.Map(document.getElementById('map_hcm'), { | |
zoom: 16, |
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 | |
/*Check duplicate values in PHP array*/ | |
$country_array = []; | |
$args = array( | |
'post_type' => 'distributor', | |
'posts_per_page' => '-1' | |
); | |
$loop = new WP_Query($args); | |
while($loop->have_posts()): $loop->the_post(); | |
$id = get_the_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 | |
function custom_taxonomer(){ | |
$wp_post_types = get_post_type(); | |
if($wp_post_types == 'product'){ | |
$languages = []; | |
$types = []; | |
echo '<h3>Documents</h3>'; | |
$documents = get_field('document_uploads'); | |
foreach ($documents as $key => $value) { | |
$resource_language = wp_get_post_terms($value->ID, 'resource_language', 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
<?php | |
function shortcode_post_object_function() { | |
ob_start(); | |
$count = 0; | |
//Get field | |
$post_objects = get_field ('post_objects'); | |
if (!empty($post_objects)) { | |
foreach ($post_objects as $post_object) { | |
$id = $post_object->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
var $ = jQuery.noConflict(); |
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_action('init', 'custom_header_scripts'); // Add Custom Scripts to wp_head | |
// Load scripts (header.php) | |
function custom_header_scripts() | |
{ | |
wp_register_script('equal-height', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.matchHeight/0.7.0/jquery.matchHeight-min.js', array('jquery'), '1.0.0'); | |
wp_enqueue_script('equal-height'); // Enqueue it! | |
wp_register_script('scripts', plugins_url('/js/scripts.js', __FILE__), array('jquery'), '1.0.0'); |
NewerOlder