Skip to content

Instantly share code, notes, and snippets.

@mostafa6765
Last active November 29, 2016 23:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mostafa6765/e452224b89542171ad6092717699f80c to your computer and use it in GitHub Desktop.
Save mostafa6765/e452224b89542171ad6092717699f80c to your computer and use it in GitHub Desktop.
Wordpress Theme basic
<?php
/**
* Proper way to enqueue scripts and styles
*/
function wp_friend_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() . '/css/main_style.css', array(),'',false );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'wp_friend_scripts' );
?>
<?php
/**
* Add custom menu in your theme
*/
function wp_friend_creat_awesome_menu(){
add_theme_support('menus');
}
add_action ('init','wp_friend_creat_awesome_menu');
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js">
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment