View Custom Search and Category Widgets WordPress
/*
WEBSITE : http://www.oldstructures.com/tag/projects/
*/
/* customer search form for widgets azizultex */
add_filter('widget_text','do_shortcode');
/* search form shortcode that populate tag automatically by tag page */
function searchFormByTag() {
View Get Categories by Tag
/*
WEBSITE : http://www.oldstructures.com/tag/projects/
*/
/* get categories related to tags */
function categoriesbytags_func() {
$tag = get_queried_object();
$args = array(
'tag' => $tag->slug,
View Custom Post Type URL Rewrite Made Easy!
/*
You can rewrite custom post type links anyway you want following below code. I have completely replaced CPT slug with a custom metabox field for each post type.
Resources:
1. http://wordpress.stackexchange.com/questions/83531/custom-post-type-404s-with-rewriting-even-after-resetting-permalinks
2. http://shibashake.com/wordpress-theme/custom-post-type-permalinks-part-2
*/
/* Register Custom Post Type */
function viz360_project_post_type() {
View Override a plugin shortcode in WordPress
Best way to override a plugin function is to use mu-plugins (Must Use Plugins)
https://gregrickaby.com/2013/10/create-mu-plugin-for-wordpress/#comment-14420
Aleternatively, follow below :
1. Copy the plugin shortcode function and put it anywhere in Child Theme and rename it like custom_cs_user_login_shortcode.
2. use 'wp_head' action to remove the plugin shortcode and register the new shortcode again with the new function name like custom_cs_user_login_shortcode.
/*********************************************
View Ajax FrontEnd File Upload WordPress With Preview
/****************************************************************
Project: MySavingWallet
Resource: http://www.ibenic.com/wordpress-file-upload-with-ajax/
HTML FORM
*****************************************************************/
<dt><?php esc_html_e( 'Support Doc', 'listify_child' ); ?></dt>
<dd>
<section>
View Google Map API for WordPress Site
function escaperoom_googlemap_api_key($url, $original_url, $_context) {
$key = 'AIzaSyAWQTIcIfpsttvugW18F1y14p8gbFXmtXE'; // your map api key
// If no key added no point in checking
if ( ! $key ) {
return $url;
}
if ( strstr( $url, "maps.google.com/maps/api/js" ) !== false || strstr( $url, "maps.googleapis.com/maps/api/js" ) !== false ) {// it's a Google maps url
View Get WooCommerce Large Images list from Gallery
View Change slug ( add_rewrite_rule ) of already registered taxonomy or custom post type
/***************************************************
USING add_rewrite_rule
****************************************************/
/* azizultex
1. https://www.ait-themes.club/knowledge-base/how-can-i-change-items-slug-and-slug-of-other-custom-post-types/
2. http://wordpress.stackexchange.com/questions/41988/redeclare-change-slug-of-a-plugins-custom-post-type
3. http://wordpress.stackexchange.com/questions/134322/rewrite-rule-for-custom-taxonomy
*/
View Clean a multidimensional array from null, 0, empty string
/* https://rogerpadilla.wordpress.com/2009/08/21/remove-empty-items-from-array/ */
function array_non_empty_items($input) {
if (!is_array($input)) {
return $input;
}
$non_empty_items = array();
foreach($input as $key => $value) {
if ($value) {
$non_empty_items[$key] = array_non_empty_items($value);
}
View Kirki demo settings
function superminimal_demo_panels_sections( $wp_customize ) {
/**
* Add Panel
*/
$wp_customize->add_panel( 'sitepoint_demo_panel', array(
'priority' => 10,
'title' => __( 'SitePoint Demo Panel', 'superminimal' ),
'description' => __( 'Kirki integration for SitePoint demo', 'superminimal' ),
) );