-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev: #3 fixed widget vers #2 add posttype and widget #2 add posttype for portfolio #1 versioning 1.0.1 start version 1 #1 # Conflicts: # dist/assets.json
- Loading branch information
Showing
21 changed files
with
649 additions
and
165 deletions.
There are no files selected for viewing
Binary file not shown.
This file was deleted.
Oops, something went wrong.
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,100 @@ | ||
<?php | ||
/** | ||
* Template Name: Home | ||
*/ | ||
?> | ||
<!-- Main Content --> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
Man must explore, and this is exploration at its greatest | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
Problems look mighty small from 150 miles up | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on September 24, 2014</p> | ||
</div> | ||
<hr> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
I believe every human has a finite number of heartbeats. I don't intend to waste any of mine. | ||
</h2> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on September 18, 2014</p> | ||
</div> | ||
<hr> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
Science has not yet mastered prophecy | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
We predict too much for the next year and yet far too little for the next ten. | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on August 24, 2014</p> | ||
</div> | ||
<hr> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
Failure is not an option | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
Many say exploration is part of our destiny, but it’s actually our duty to future generations. | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on July 8, 2014</p> | ||
</div> | ||
<hr> | ||
<!-- Pager --> | ||
<ul class="pager"> | ||
<li class="next"> | ||
<a href="#">Older Posts →</a> | ||
</li> | ||
</ul> | ||
<div class="container"> | ||
<div class="row"> | ||
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1"> | ||
<?php | ||
global $post; | ||
$args=array( | ||
'post_type' => 'post', | ||
'post_status' => 'publish', | ||
'orderby' => 'date', | ||
'order' => 'DESC', | ||
'posts_per_page'=>-1, | ||
); | ||
$posts = get_posts( $args ); | ||
if ($posts) : | ||
|
||
foreach ($posts as $post) { | ||
|
||
setup_postdata($post); | ||
?> | ||
<div class="post-preview"> | ||
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"> | ||
<h2 class="post-title"> | ||
<?php the_title();?> | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
<?php the_content(); ?> | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#"><?php the_author();?></a> on <?php the_date(); ?></p> | ||
</div> | ||
<hr> | ||
<?php | ||
} | ||
|
||
wp_reset_postdata(); | ||
endif; | ||
?> | ||
<!-- | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
Man must explore, and this is exploration at its greatest | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
Problems look mighty small from 150 miles up | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on September 24, 2014</p> | ||
</div> | ||
<hr> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
I believe every human has a finite number of heartbeats. I don't intend to waste any of mine. | ||
</h2> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on September 18, 2014</p> | ||
</div> | ||
<hr> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
Science has not yet mastered prophecy | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
We predict too much for the next year and yet far too little for the next ten. | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on August 24, 2014</p> | ||
</div> | ||
<hr> | ||
<div class="post-preview"> | ||
<a href="post.html"> | ||
<h2 class="post-title"> | ||
Failure is not an option | ||
</h2> | ||
<h3 class="post-subtitle"> | ||
Many say exploration is part of our destiny, but it’s actually our duty to future generations. | ||
</h3> | ||
</a> | ||
<p class="post-meta">Posted by <a href="#">Start Bootstrap</a> on July 8, 2014</p> | ||
</div> | ||
<hr> | ||
--> | ||
<!-- Pager | ||
<ul class="pager"> | ||
<li class="next"> | ||
<a href="?get=all">Older Posts →</a> | ||
</li> | ||
</ul> | ||
--> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<?php | ||
/** meta box page attribute We Hiring Dropdown Pages link | ||
======================================================*/ | ||
add_action('admin_init', 'cleanblog_themes_meta_box_intro_admin_init'); | ||
add_action( 'save_post', 'cleanblog_themes_meta_box_intro_callback_save' ); | ||
|
||
function cleanblog_themes_meta_box_intro_admin_init() { | ||
add_meta_box( 'cleanblog-meta-box-intro-page-id', | ||
'Intro Banner', | ||
'cleanblog_meta_box_callback', | ||
'page', | ||
'normal', | ||
'high' ); | ||
add_meta_box( 'cleanblog-meta-box-intro-post-id', | ||
'Intro Banner', | ||
'cleanblog_meta_box_callback', | ||
'post', | ||
'normal', | ||
'high' ); | ||
} | ||
|
||
function cleanblog_meta_box_callback(){ | ||
//echo "HELLO World!"; | ||
global $post; | ||
|
||
$values = get_post_custom( $post->ID ); | ||
$text_h1 = isset( $values['cleanblog_themes_meta_box_intro_h1_text'] ) ? $values['cleanblog_themes_meta_box_intro_h1_text'] : ''; | ||
$text_span = isset( $values['cleanblog_themes_meta_box_intro_span_text'] ) ? $values['cleanblog_themes_meta_box_intro_span_text'] : ''; | ||
|
||
$banner_select = isset( $values['cleanblog_themes_meta_box_intro_banner_select'] ) ? $values['cleanblog_themes_meta_box_intro_banner_select'] : ''; | ||
|
||
|
||
wp_nonce_field( 'mekar_meta_box_nonce', 'meta_box_nonce' ); | ||
?> | ||
<p><strong>Heading</strong></p> | ||
<label class="screen-reader-text" for="cleanblog_themes_meta_box_intro_h1_text">Heading</label> | ||
<input type="text" name="cleanblog_themes_meta_box_intro_h1_text" id="cleanblog_themes_meta_box_intro_h1_text" value="<?php echo $text_h1[0];?>" placeholder="[:en]...[:id]..." style="width: 100%;" /> | ||
|
||
<p><strong>Sub Heading</strong></p> | ||
<label class="screen-reader-text" for="cleanblog_themes_meta_box_intro_span_text">Sub Heading</label> | ||
<input type="text" name="cleanblog_themes_meta_box_intro_span_text" id="cleanblog_themes_meta_box_intro_span_text" value="<?php echo $text_span[0];?>" placeholder="[:en]...[:id]..." style="width: 100%;"/> | ||
<?php | ||
|
||
// run custom type post_type | ||
global $post; | ||
|
||
$args = array('post_type' => 'banner','posts_per_page'=>-1); | ||
$posts = get_posts( $args ); | ||
|
||
if($posts): ?> | ||
<p><strong>Select Banner</strong></p> | ||
<label class="screen-reader-text" for="cleanblog_themes_meta_box_intro_banner_select">Change Banner Image</label> | ||
<select name="cleanblog_themes_meta_box_intro_banner_select" id="cleanblog_themes_meta_box_intro_banner_select"> | ||
<?php | ||
if($banner_select[0] and !empty($banner_select[0])): | ||
?> | ||
<option value="<?php echo $banner_select[0]?>"><?php echo get_the_title($banner_select[0]);?></option> | ||
<?php | ||
endif; | ||
?> | ||
<option value="">-- Default -- </option> | ||
<?php | ||
foreach ($posts as $post) { | ||
setup_postdata($post); | ||
?> | ||
<option value="<?php echo $post->ID;?>"><?php the_title();?></option> | ||
<?php | ||
} | ||
?> | ||
</select> | ||
<?php | ||
wp_reset_postdata(); | ||
endif; | ||
} | ||
|
||
function cleanblog_themes_meta_box_intro_callback_save( $post_id ) | ||
{ | ||
// Bail if we're doing an auto save | ||
if( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; | ||
|
||
// if our nonce isn't there, or we can't verify it, bail | ||
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'mekar_meta_box_nonce' ) ) return; | ||
|
||
// if our current user can't edit this post, bail | ||
if( !current_user_can( 'edit_post' ) ) return; | ||
|
||
// now we can actually save the data | ||
$allowed = array( | ||
'a' => array( // on allow a tags | ||
'href' => array() // and those anchors can only have href attribute | ||
) | ||
); | ||
|
||
// Make sure your data is set before trying to save it | ||
if( isset( $_POST['cleanblog_themes_meta_box_intro_h1_text'] ) ) | ||
update_post_meta( $post_id, 'cleanblog_themes_meta_box_intro_h1_text', wp_kses( $_POST['cleanblog_themes_meta_box_intro_h1_text'], $allowed ) ); | ||
|
||
if( isset( $_POST['cleanblog_themes_meta_box_intro_span_text'] ) ) | ||
update_post_meta( $post_id, 'cleanblog_themes_meta_box_intro_span_text', esc_attr( $_POST['cleanblog_themes_meta_box_intro_span_text'] ) ); | ||
|
||
if( isset( $_POST['cleanblog_themes_meta_box_intro_banner_select'] ) ) | ||
update_post_meta( $post_id, 'cleanblog_themes_meta_box_intro_banner_select', esc_attr( $_POST['cleanblog_themes_meta_box_intro_banner_select'] ) ); | ||
|
||
} |
Oops, something went wrong.