functions.php - Visual Studio Code
function custom_enqueue_scripts() { wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/style.css'); wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/script.js', array('jquery'), null, true); }
add_action('wp_enqueue_scripts', 'custom_enqueue_scripts'); function custom_post_type() { register_post_type('portfolio', array( 'labels' => array( 'name' => __('Portfolio'), 'singular_name' => __('Portfolio Item') ), 'public' => true, 'has_archive' => true, ) ); }
add_filter('the_content', 'add_signature'); function add_signature($content) { if (is_single()) { $content .= '<p>Posted by ' . get_the_author() . '</p>'; } return $content; }
function custom_shortcode($atts) { $atts = shortcode_atts(array( 'text' => 'Hello, World!' ), $atts); return '<div class="custom-shortcode">' . esc_html($atts['text']) . '</div>'; } add_shortcode('my_shortcode', 'custom_shortcode');
function custom_menu() { register_nav_menus( array( 'primary' => __('Primary Menu'), 'footer' => __('Footer Menu') ) ); } add_action('init', 'custom_menu');
function custom_enqueue_scripts() { wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/style.css'); wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/script.js', array('jquery'), null, true); }
add_action('wp_enqueue_scripts', 'custom_enqueue_scripts'); function custom_post_type() { register_post_type('portfolio', array( 'labels' => array( 'name' => __('Portfolio'), 'singular_name' => __('Portfolio Item') ), 'public' => true, 'has_archive' => true, ) ); }
add_filter('the_content', 'add_signature'); function add_signature($content) { if (is_single()) { $content .= '<p>Posted by ' . get_the_author() . '</p>'; } return $content; }
function custom_shortcode($atts) { $atts = shortcode_atts(array( 'text' => 'Hello, World!' ), $atts); return '<div class="custom-shortcode">' . esc_html($atts['text']) . '</div>'; } add_shortcode('my_shortcode', 'custom_shortcode');
function custom_menu() { register_nav_menus( array( 'primary' => __('Primary Menu'), 'footer' => __('Footer Menu') ) ); } add_action('init', 'custom_menu');
function custom_enqueue_scripts() { wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/style.css'); wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/script.js', array('jquery'), null, true); }
add_action('wp_enqueue_scripts', 'custom_enqueue_scripts'); function custom_post_type() { register_post_type('portfolio', array( 'labels' => array( 'name' => __('Portfolio'), 'singular_name' => __('Portfolio Item') ), 'public' => true, 'has_archive' => true, ) ); }
add_filter('the_content', 'add_signature'); function add_signature($content) { if (is_single()) { $content .= '<p>Posted by ' . get_the_author() . '</p>'; } return $content; }
function custom_shortcode($atts) { $atts = shortcode_atts(array( 'text' => 'Hello, World!' ), $atts); return '<div class="custom-shortcode">' . esc_html($atts['text']) . '</div>'; } add_shortcode('my_shortcode', 'custom_shortcode');
function custom_menu() { register_nav_menus( array( 'primary' => __('Primary Menu'), 'footer' => __('Footer Menu') ) ); } add_action('init', 'custom_menu');
function custom_enqueue_scripts() { wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/style.css'); wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/script.js', array('jquery'), null, true); }
add_action('wp_enqueue_scripts', 'custom_enqueue_scripts'); function custom_post_type() { register_post_type('portfolio', array( 'labels' => array( 'name' => __('Portfolio'), 'singular_name' => __('Portfolio Item') ), 'public' => true, 'has_archive' => true, ) ); }
add_filter('the_content', 'add_signature'); function add_signature($content) { if (is_single()) { $content .= '<p>Posted by ' . get_the_author() . '</p>'; } return $content; }
function custom_shortcode($atts) { $atts = shortcode_atts(array( 'text' => 'Hello, World!' ), $atts); return '<div class="custom-shortcode">' . esc_html($atts['text']) . '</div>'; } add_shortcode('my_shortcode', 'custom_shortcode');
function custom_menu() { register_nav_menus( array( 'primary' => __('Primary Menu'), 'footer' => __('Footer Menu') ) ); } add_action('init', 'custom_menu');
function custom_enqueue_scripts() { wp_enqueue_style('custom-style', get_stylesheet_directory_uri() . '/style.css'); wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/script.js', array('jquery'), null, true); }
add_action('wp_enqueue_scripts', 'custom_enqueue_scripts'); function custom_post_type() { register_post_type('portfolio', array( 'labels' => array( 'name' => __('Portfolio'), 'singular_name' => __('Portfolio Item') ), 'public' => true, 'has_archive' => true, ) ); }
add_filter('the_content', 'add_signature'); function add_signature($content) { if (is_single()) { $content .= '<p>Posted by ' . get_the_author() . '</p>'; } return $content; }
function custom_shortcode($atts) { $atts = shortcode_atts(array( 'text' => 'Hello, World!' ), $atts); return '<div class="custom-shortcode">' . esc_html($atts['text']) . '</div>'; } add_shortcode('my_shortcode', 'custom_shortcode');
function custom_menu() { register_nav_menus( array( 'primary' => __('Primary Menu'), 'footer' => __('Footer Menu') ) ); } add_action('init', 'custom_menu');