Skip to content

Instantly share code, notes, and snippets.

@BeholdPL
BeholdPL / new_menu.php
Created March 22, 2021 01:10
Register new #menu #wordpress
<?php
// menu
register_nav_menus( array(
'main_menu' => __( 'Primary Menu', 'text-domain' );
// other stuff
);
// primary menu
function registerPrimaryMenu() {
@BeholdPL
BeholdPL / new_widget_area.php
Created March 22, 2021 00:47
New widget area #wordpress #widget #sidebar
<?php
function newWidgetsArea() {
register_sidebar( array(
'name' => __( 'Stopka 1', 'text-domain' ),
'id' => 'footer-1-col',
'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'text-domain' ),
'before_widget' => '<li id="%1$s" class="widget %2$s">',
'after_widget' => '</li>',
'before_title' => '<h2 class="widgettitle">',
@BeholdPL
BeholdPL / is_wpml.php
Last active March 22, 2021 00:44
is WPML #wordpress #wpml
<?php
// if WPML active
if ( class_exists('SitePress') ) {
// stuff
}
@BeholdPL
BeholdPL / is_polylang.php
Last active March 22, 2021 01:12
is Polylang #wordpress #polylang
<?php
// if Polylang active
if ( function_exists('pll_the_languages') {
// stuff
}