Custom Theme

Wed ( 30/07/2025 02:52:08 )
CustomTheme
 
WordPress
Index
 

1. csneutrontheme
2. Theme Structure
3. style.css 
 
 
1. csneutronstheme
  http://wp.jcs.com/wp-login.php
   
 
2. Theme Structure
.1 Themes
 
+ Themes \   
    + csneutrons_theme \
        + css /
            –  main.css
        + js / 
        + images /
        + includes /
            – section-content.php
 
        – index.php
        – 404.php
        – function.php
        – style.css    
 
        – single.php
        – page.php
        – search.php
        – archive.php
 
        – front-page.php       
        – header.php
        – footer.php
 
3. style.css
 
/**
Theme Name: CSNeutrons Theme
Author: Chulsung
**/
 
4. front-page.php
  http://wp.jcs.com/
 
<?php get_header(); ?>
 
<section class=”page-wrap”>
  <div class=”container”>

    <h1><?php the_title(); ?></h1>
    <?php get_template_part(‘includes/section’, ‘content’);?>

  </div>
</section>
 
<?php get_footer(); ?>
 
5. page.php
  http://wp.jcs.com/about-us/
 
<?php get_header(); ?>

<div class=”container”>

    <h1><?php the_title(); ?></h1>
    <?php get_template_part(‘includes/section’, ‘content’);?>

</div>
<?php get_footer(); ?>
 
 
  header.php
 
<!DOCTYPE html>
<html lang=”en”>
<head>
  <meta charset=”UTF-8″>
  <title>Document</title>

  <?php wp_head();?>
  <link href=”style.css” rel=”stylesheet”>
</head>
 
<header> 
</header>
  includes / section-content.php
 
<?php if( have_posts() ): while( have_posts()): the_post();?>
<?php
  the_content();
?>
<?php endwhile; else: endif;?>
 
footer.php
 
<?php wp_footer();?>
</body>
</html>
 
 
functions.php
   
 
<?php

function load_css()
{
    wp_register_style(‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap.min.css’, array(), false, ‘all’);  
    wp_enqueue_style(‘bootstrap’);
}

add_action(‘wp_enqueue_scripts’, ‘load_css’);


function load_js()
{
    wp_register_script(‘bootstrap’, get_template_directory_uri() . ‘/js/bootstrap.min.js’, ‘jquery’, false, false);  
    wp_enqueue_script(‘bootstrap’);
}

add_action(‘wp_enqueue_scripts’, ‘load_js’);

?>
 
Home — Front Page
 
Pages
 
1. Home 
2. Content  
  Settings / Reading / Reading Settings / Your homepage displays
 
A static page 
    Homepage: Home  
    Posts page: Content
 
Contact Us Page
.1 Pages / Contact Us
 
1 Quick Edit
    Title: Contact Us
    Parent: Main Page
    Slug: contact-us
 
2. Edit / Page
    Template: Contact Us
.2 template-contactus.php
 
 
<?php
/*
Template Name: Contact Us
*/
?>
<?php get_header(); ?>

<div class=”container”>

    <h1><?php the_title(); ?></h1>
    <div class=”row”>
        <div class=”col-lg-6″>
            This is where the contact form goes
        </div>
        <div class=”col-lg-6″>
            <?php get_template_part(‘includes/section’, ‘content’); ?>      
        </div>
    </div>

</div>
<?php get_footer(); ?>
 
 
header-secondary.php
  <?php get_header(‘secondary’); ?>
 
 
<!DOCTYPE html>
<html lang=”en”>
<head>
  <meta charset=”UTF-8″>
  <title>Document</title>

  <?php wp_head();?>
  <link href=”style.css” rel=”stylesheet”>
</head>
<body>
This is the Second Header
 
 
 
 
 
Posted by