Skip to content

Instantly share code, notes, and snippets.

View oziriemeka's full-sized avatar
🚀
Lets write clean codes

Neon Emmanuel oziriemeka

🚀
Lets write clean codes
View GitHub Profile
@oziriemeka
oziriemeka / nigeria-states.json
Created May 18, 2019 02:58 — forked from mofesolapaul/nigeria-states.json
List of all Nigerian states, alphabetically arranged in JSON array
[
"Abia",
"Adamawa",
"Anambra",
"Akwa Ibom",
"Bauchi",
"Bayelsa",
"Benue",
"Borno",
"Cross River",
@oziriemeka
oziriemeka / GET ALL CATEGORIES IN WOOCOMMERCE
Created January 30, 2018 11:52 — forked from OneStep21/GET ALL CATEGORIES IN WOOCOMMERCE
HOW TO GET ALL CATEGORIES , SUB-CATEGORIES AND PRODUCTS IN WOOCOMMERCE WORDPRESS PLUGIN ( This will list all the top level categories and subcategories under them hierarchically. do not use the inner query if you just want to display the top level categories. Style it as you like. )
<?php
$taxonomy = 'product_cat';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = '';
$empty = 0;
@oziriemeka
oziriemeka / yourfile.php
Last active December 7, 2017 12:04
WordPress - Add custom edit post link
<?php if(current_user_can('administrator')){ ?>
<a href="<?php bloginfo('url');?>/wp-admin/edit.php?p=<?php the_ID(); ?>">Edit Post</a>
<?php } ?>
}