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 | |
/** | |
* @since 1.0.0 | |
* @package MyPlugin | |
* @subpackage PostType | |
* @author XXXXX | |
*/ | |
namespace MyPlugin\Controllers; |
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 | |
/** | |
* Funciones Útiles Wordpress / Useful functions for wordpress | |
*/ | |
// Print Nav Menu | |
// https://developer.wordpress.org/reference/functions/wp_nav_menu/ | |
//--------------------------------------------------------------- | |
wp_nav_menu(array( |
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 | |
/** | |
* Install database tables | |
*/ | |
public function db_install_recordings() | |
{ | |
global $wpdb; | |
$table_name = $wpdb->prefix . "myprefix_mytable"; | |
$charset_collate = $wpdb->get_charset_collate(); |
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
WordPress Advanced Programming Functions - Some nice function to make your website nicer |
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 | |
//Add a stylesheet after WC styles | |
add_action( 'wp_enqueue_scripts', 'maira_add_stylesheet' ); | |
function maira_add_stylesheet() { | |
wp_register_style( 'woocommerce', get_stylesheet_directory_uri() . '/woocommerce/woocommerce.css' ); | |
if ( class_exists( 'woocommerce' ) ) { | |
wp_enqueue_style( 'woocommerce' ); | |
} | |
} |
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 | |
add_action( 'woocommerce_after_subcategory', 'dlm_display_subcategories_on_category', 12 ); | |
function dlm_display_subcategories_on_category( $category ) | |
{ | |
$cat_id = $category->term_id; | |
$taxonomy = 'product_cat'; | |
// Get subcategories of the current category |
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 | |
/** | |
* @package DlmWpTheme | |
*/ | |
// Exit if accessed directly. | |
defined('ABSPATH') || exit; | |
require_once dirname(__FILE__) . '/class-interface-package.php'; | |
require_once dirname(__FILE__) . '/class-interface-package-shortcode.php'; |
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 | |
/** | |
* | |
* Secret-Keys, Sprache und ABSPATH. Mehr Informationen zur wp-config.php gibt es auf der {@link http://codex.wordpress.org/Editing_wp-config.php | |
* | |
* und die Installationsroutine (/wp-admin/install.php) aufgerufen wird. | |
* Man kann aber auch direkt in dieser Datei alle Eingaben vornehmen und sie von wp-config-sample.php in wp-config.php umbenennen und die Installation starten. | |
* | |
* @package WordPress | |
*/ |
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 | |
// This function is used to display manufactures of products | |
// With ACF create a true/false field "show_manufacturer" | |
// Create main categories and subcategories (manufactures) and add a logo | |
/** | |
* Display subcategories of a main category - using ACF fields | |
* @author Pascal Lehnert | |
* @copyright 2021-02-28 | |
*/ |