Skip to content

Commit

Permalink
Front-page template design
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhaniffa committed Jul 26, 2017
1 parent 6305fab commit 5e90a80
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
23 changes: 23 additions & 0 deletions front-page.php
@@ -0,0 +1,23 @@
<?php
/**
* The main template file.
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package ReactVerse
* Template Name: Frontpage
*/

get_header(); ?>

<div id="primary" class="content-area">
<main id="main" class="site-main" role="main" aria-live="assertive" tabindex="-1"></main><!-- #main -->
</div><!-- #primary -->

<?php get_sidebar(); ?>
<?php get_footer(); ?>
12 changes: 12 additions & 0 deletions js/components/post/front-page.jsx
@@ -0,0 +1,12 @@
import React from 'react';

const FrontPage = React.createClass({

render() {
return (
<div>Frontpage content here</div>
);
}
})

export default FrontPage;
9 changes: 9 additions & 0 deletions js/components/post/page.jsx
Expand Up @@ -16,16 +16,25 @@ import Media from './image';
import Comments from '../comments';
import Placeholder from '../placeholder';
import PostPreview from './preview';
import FrontPage from './front-page';

const SinglePage = React.createClass( {
mixins: [ ContentMixin ],

renderArticle() {
const post = this.props.post;
console.log('page.jsx', 'post', post);

if ( ! post ) {
return null;
}

const template = post.template.split('.')[0];
if ( template == 'front-page' ) {
return <FrontPage />
}


const meta = {
title: post.title.rendered + ' – ' + ReactVerseSettings.meta.title,
description: post.excerpt.rendered,
Expand Down

0 comments on commit 5e90a80

Please sign in to comment.