Skip to content

Instantly share code, notes, and snippets.

View digital-brew's full-sized avatar

DigitalBrew digital-brew

  • United Kingdom
  • 10:01 (UTC)
View GitHub Profile
<form name="myform" method="GET" action="<?php echo esc_url(home_url('/'));?>">
<?php if (class_exists('WooCommerce')): ?>
<?php
if (isset($_REQUEST['product_cat']) && !empty($_REQUEST['product_cat'])) {
$optsetlect = $_REQUEST['product_cat'];
} else {
$optsetlect = 0;
}
$args = array(
@digital-brew
digital-brew / custom-template-plugin.php
Created January 11, 2020 01:11 — forked from ashokmhrj/custom-template-plugin.php
Get Template Part From plugin directory
<?php
/**
* The below function will help to load template file from plugin directory of wordpress
* Extracted from : http://wordpress.stackexchange.com/questions/94343/get-template-part-from-plugin
*/
define('PLUGIN_DIR_PATH','Your-plugin-directory-path');
function ccm_get_template_part($slug, $name = null) {
do_action("ccm_get_template_part_{$slug}", $slug, $name);