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
// Get $product object from product ID | |
$product = wc_get_product( $product_id ); | |
// Get Product ID | |
$product->get_id(); (fixes the error: "Notice: id was called incorrectly. Product properties should not be accessed directly") | |
// Get Product General Info | |
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 ($) { | |
"use strict"; | |
// dropdown menu scroll | |
$(document).ready(function(){ | |
var x = $('.dropdown-item'); | |
var y = $('.dropdown-menu').find(x).length; | |
$('.dropdown-menu').each(function(){ | |
var v = $(this).find(x).length; |
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="row"> | |
<div class="col-md-5"> | |
<h6>Type of Business</h6> | |
<ul class="list-icon list-icon-check"> | |
<li>Industry Type</li> | |
<li>SIC Codes</li> | |
<li>NAICS Codes</li> | |
<li>Size of Business</li> | |
<li>Number of Employees</li> | |
<li>Sales Volume</li> |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME}\.php !-f | |
RewriteRule ^item/([0-9a-zA-A_-]+)/([0-9a-zA-Z_-]+) index.php?tslug=$2&cat=$1 [NC,L] |
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
//write a .htaccess file with this | |
<IfModule mod_rewrite.c> | |
Options -MultiViews | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteRule ^ index.html [QSA,L] | |
</IfModule> |
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 block_wpadmin() { | |
$file = basename($_SERVER['PHP_SELF']); | |
if ($file == 'wp-login.php' || is_admin() && !current_user_can('edit_posts') && $file != 'admin-ajax.php'){ | |
wp_redirect( home_url() ); | |
exit(); | |
} | |
} | |
add_action('init', 'block_wpadmin'); |
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_filter('show_admin_bar','codingeek_show_admin_bar'); | |
function codingeek_check_user_validation(){ | |
$current_user = wp_get_current_user(); | |
if ( in_array('subscriber', $current_user)) { | |
//have to write code for subscriber | |
show_admin_bar( false ); // for hide adminbar | |
}; |
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 | |
//Get data from instagram api | |
$hashtag = 'max'; | |
//Query need client_id or access_token | |
$query = array( | |
'client_id' => '', | |
'count' => 3 | |
); | |
$url = 'https://api.instagram.com/v1/tags/'.$hashtag.'/media/recent?'.http_build_query($query); | |
try { |
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 | |
//make unique multidimensional array | |
public static function unique_multidim_array($array, $key) { | |
$temp_array = array(); | |
$i = 0; | |
$key_array = array(); | |
foreach($array as $val) { |
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 | |
// multidimensional array sorting | |
$array = Array | |
( | |
0 => Array | |
( | |
'hashtag' => 'a7e87329b5eab8578f4f1098a152d6f4', | |
'title' => 'Flower', | |
'order' => 3, | |
), |