Skip to content

Instantly share code, notes, and snippets.

@AlkarE
AlkarE / custom_post.php
Last active August 29, 2015 14:25
custom_post_plugin
<?php
/*Plugin Name: Create Picture post type and Album category
Description: This plugin registers the 'Picture' post type.
Version: 1.0
License: GPLv2
*/
function picture_post_type() {
$labels = array(
'name' => 'Picture',
@AlkarE
AlkarE / custom_logo.php
Created June 7, 2015 09:15
custom_logo_in_customizer
// custom-logo => goes to function.php
function themeslug_theme_customizer( $wp_customize ) {
$wp_customize->add_section( 'themeslug_logo_section' , array(
'title' => __( 'Branding Logo', 'themeslug' ),
'priority' => 30,
'description' => 'Upload a logo to replace the default site name and description in the header',
) );
$wp_customize->add_setting( 'themeslug_logo' );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'themeslug_logo', array(
'label' => __( 'Logo', 'themeslug' ),
@AlkarE
AlkarE / dinamic_sidebar
Created June 3, 2015 08:01
dinamic sidebar
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("sidebar name") ) :endif; ?>