This file contains hidden or 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 filed in the categoy*************************/ | |
add_action( 'init', 'wpm_product_cat_register_meta' ); | |
/** | |
* Register details product_cat meta. | |
* | |
* Register the details metabox for WooCommerce product categories. | |
* | |
*/ | |
function wpm_product_cat_register_meta() { |
This file contains hidden or 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 | |
define('WYSIWYG_META_BOX_ID', 'my-editor'); | |
define('WYSIWYG_EDITOR_ID', 'myeditor'); //Important for CSS that this is different | |
define('WYSIWYG_META_KEY', 'extra-content'); | |
add_action('admin_init', 'wysiwyg_register_meta_box'); | |
function wysiwyg_register_meta_box(){ | |
add_meta_box(WYSIWYG_META_BOX_ID, __('WYSIWYG Meta Box', 'wysiwyg'), 'wysiwyg_render_meta_box', 'post'); | |
} |
This file contains hidden or 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 meta box to the new/edit category pages. | |
* The meta data is saved to the array term_meta[], which can handle further | |
* fields in the future. | |
* | |
* Based on: https://pippinsplugins.com/adding-custom-meta-fields-to-taxonomies/ | |
*/ | |
/** |
This file contains hidden or 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_body_classes($classes) | |
{ | |
// the list of WordPress global browser checks | |
// https://codex.wordpress.org/Global_Variables#Browser_Detection_Booleans | |
$browsers = ['is_iphone', 'is_chrome', 'is_safari', 'is_NS4', 'is_opera', 'is_macIE', 'is_winIE', 'is_gecko', 'is_lynx', 'is_IE', 'is_edge']; | |
// check the globals to see if the browser is in there and return a string with the match | |
$classes[] = join(' ', array_filter($browsers, function ($browser) { |
This file contains hidden or 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 op_enqueue_scripts() { | |
wp_enqueue_style( | |
'op-ie8', | |
get_template_directory_uri() . '/assets/css/ie8.css', | |
array(), | |
'0.0.7' | |
); | |
wp_style_add_data( 'op-ie8', 'conditional', 'IE 8' ); | |
This file contains hidden or 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( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
/** | |
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE. | |
* IE10 and up does not support conditional comments in standards mode. | |
* | |
* @uses wp_style_add_data() WordPress function to add the conditional data. | |
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/ |
This file contains hidden or 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 | |
/* ============================================================================= | |
MCE FILTERS | |
========================================================================== */ | |
/** | |
http://wp.tutsplus.com/tutorials/theme-development/adding-custom-styles-in-wordpress-tinymce-editor/ | |
* | |
inline | |
Name of the inline element to produce for example “span”. The current text selection will be wrapped in this inline element. |
This file contains hidden or 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
<!-- HEAD SECTION --> | |
<!-- IE Edge Meta Tag --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<!-- Viewport --> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- Minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> |
This file contains hidden or 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 | |
$caseNo = 0; | |
foreach (range(1, 9) as $numberOne) { | |
$makeNumberOne = ($numberOne * 100) + 62; | |
foreach (range(1, 9) as $numberTwo) { |
This file contains hidden or 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 | |
/** | |
* Show posts which are only under uncategorized term | |
* 1 is the id of Uncategorized term | |
*/ | |
function op_show_only_uncategorized( $query ) { | |
if ( is_admin() || ! $query->is_main_query() || ! $query->is_category( 1 ) ) { | |
return; | |
} | |