Initial commit with no customisation yet (except READMEs)

This commit is contained in:
Hippo 2019-08-03 17:43:10 +05:30
commit 8a69142c55
6 changed files with 300 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.idea/

0
LICENSE Normal file
View file

43
README.md Normal file
View file

@ -0,0 +1,43 @@
Independent Snipette
===========================
This theme contains [Snipette](https://snipettemag.com)-specific
customisations to the [Independent Publisher](http://independentpublisher.me)
theme, and is built using the
[Independent Publisher Child Theme](https://github.com/raamdev/independent-publisher-child-theme)
as a base. Instructions for the Independent Publisher Child theme are
given below...
For a complete list of functions you can override in this child theme,
please see [Functions you can override in a Child Theme](https://github.com/raamdev/independent-publisher#functions-you-can-override-in-a-child-theme).
## Installation
This [Child Theme](http://codex.wordpress.org/Child_Themes) requires
the parent Independent Publisher theme, so be sure that you have that
installed first. Then, simply download this child theme and place it
your `wp-content/themes/` folder and then activate it from
**Appearance → Themes**.
**IMPORTANT NOTE:** If you downloaded the Independent Publisher theme
from GitHub, the theme folder name might be
`independent-publisher-master`. If that is the case, _you must_ rename
the theme directory to `independent-publisher`, as that is what the
Child Theme looks for.
Once this Child Theme has been activated, you can start making changes
to the child theme's `style.css` file and/or `functions.php`. The
changes you make in those files will simply override the parent theme's
styles and functions.
See the comments in `style.css` and `functions.php` for examples.
## Templates
A [Page Template](http://codex.wordpress.org/Page_Templates#Custom_Page_Template)
can be selected from the Page Attributes meta box when editing or
creating a new WordPress Page. The following page templates are
included in this Child Theme:
* **Archive Page:** Displays Search box, Recent Posts, Most
Used Categories, Monthly Archives, and Tag Cloud.

145
functions.php Normal file
View file

@ -0,0 +1,145 @@
<?php
/*
* You can add your own functions here. You can also override functions that are
* called from within the parent theme. For a complete list of function you can
* override here, please see the docs:
*
* https://github.com/raamdev/independent-publisher#functions-you-can-override-in-a-child-theme
*
*/
/*
* Uncomment the following to add a favicon to your site. You need to add favicon
* image to the images folder of Independent Publisher Child Theme for this to work.
*/
/*
function blog_favicon() {
echo '<link rel="Shortcut Icon" type="image/x-icon" href="'.get_bloginfo('stylesheet_directory').'/images/favicon.ico" />' . "\n";
}
add_action('wp_head', 'blog_favicon');
*/
/*
* Add version number to main style.css file with version number that matches the
* last modified time of the file. This helps when making frequent changes to the
* CSS file as the browser will always load the newest version.
*/
/*
function independent_publisher_stylesheet() {
wp_enqueue_style( 'independent-publisher-style', get_stylesheet_uri(), '', filemtime( get_stylesheet_directory() . '/style.css') );
}
*/
/*
* Modifies the default theme footer.
* This also applies the changes to JetPack's Infinite Scroll footer, if you're using that module.
*/
/*
function independent_publisher_footer_credits() {
$my_custom_footer = 'This is my custom footer.';
return $my_custom_footer;
}
*/
/* * * * * *
* Authors *
* * * * * */
function independent_publisher_posted_author() {
/**
* This function gets called outside the loop (in header.php),
* so we need to figure out the post author ID and Nice Name manually.
*/
global $wp_query;
if ( function_exists( 'get_coauthors') ) {
$coauthors = get_coauthors( $wp_query->post->ID );
printf('<span class="byline">');
$i = 0;
foreach($coauthors as $author) {
$i++; // keep track of how many we've processed
$post_author_id = $author->ID;
$post_author_nice_name = get_the_author_meta( 'display_name', $post_author_id );
printf(
'<span class="author p-author vcard h-card"><a class="u-url url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID', $post_author_id ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'independent-publisher' ), $post_author_nice_name ) ),
esc_html( $post_author_nice_name )
);
if ( $i < (sizeof($coauthors) - 1) ) {
// Add comma for all but last two authors.
printf(', ');
} else if ( $i == (sizeof($coauthors) - 1) ) {
// Add "and" for second-last authors
printf(' and ');
}
printf('Size: %$1d', sizeof($coauthors));
// if last author, do nothing
}
printf('</span>');
} else {
$post_author_id = $wp_query->post->post_author;
$post_author_nice_name = get_the_author_meta( 'display_name', $post_author_id );
printf(
'<span class="byline"><span class="author p-author vcard h-card"><a class="u-url url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID', $post_author_id ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'independent-publisher' ), $post_author_nice_name ) ),
esc_html( $post_author_nice_name )
);
}
}
/* * * * * * * * *
* Author cards *
* * * * * * * * */
function independent_publisher_posted_author_card() {
/**
* This function gets called outside the loop (in header.php),
* so we need to figure out the post author ID and Nice Name manually.
*/
global $wp_query;
$post_author_id = $wp_query->post->post_author;
$show_avatars = get_option( 'show_avatars' );
?>
<?php if ( ( !$show_avatars || $show_avatars === 0 ) && !independent_publisher_is_multi_author_mode() && get_header_image() ) : ?>
<a class="site-logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
<img class="no-grav" src="<?php echo esc_url( get_header_image() ); ?>" height="<?php echo absint( get_custom_header()->height ); ?>" width="<?php echo absint( get_custom_header()->width ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" />
</a>
<?php else: ?>
<a class="site-logo" href="<?php echo get_author_posts_url( get_the_author_meta( 'ID', $post_author_id ) ); ?>">
<?php echo get_avatar( get_the_author_meta( 'ID', $post_author_id ), 100 ); ?>
</a>
<?php endif; ?>
<div class="site-title"><?php independent_publisher_posted_author(); ?></div>
<div class="site-description"><?php the_author_meta( 'description', $post_author_id ) ?></div>
<?php get_template_part( 'menu', 'social' ); ?>
<div class="site-published-separator"></div>
<h2 class="site-published"><?php _e( 'Published', 'independent-publisher' ); ?></h2>
<h2 class="site-published-date"><?php independent_publisher_posted_on_date(); ?></h2>
<?php /* Show last updated date if the post was modified AND
Show Updated Date on Single Posts option is enabled AND
'independent_publisher_hide_updated_date' Custom Field is not present on this post */ ?>
<?php if ( get_the_modified_date() !== get_the_date() &&
independent_publisher_show_updated_date_on_single() &&
!get_post_meta( get_the_ID(), 'independent_publisher_hide_updated_date', true )
) : ?>
<h2 class="site-published"><?php _e( 'Updated', 'independent-publisher' ); ?></h2>
<h2 class="site-published-date"><?php independent_publisher_post_updated_date(); ?></h2>
<?php endif; ?>
<?php do_action( 'independent_publisher_after_post_published_date' ); ?>
<?php
}

52
page-archive.php Normal file
View file

@ -0,0 +1,52 @@
<?php
/**
* The template used for displaying Archive page content
* Template Name: Archives
*/
get_header(); ?>
<div id="primary" class="content-area">
<div id="content" class="site-content" role="main">
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php get_search_form(); ?>
<?php the_widget( 'WP_Widget_Recent_Posts' ); ?>
<div class="widget">
<h2 class="widgettitle"><?php _e( 'Most Used Categories', 'independent_publisher' ); ?></h2>
<ul>
<?php wp_list_categories( array( 'orderby' => 'count', 'order' => 'DESC', 'show_count' => 1, 'title_li' => '', 'number' => 10 ) ); ?>
</ul>
</div>
<!-- .widget -->
<?php the_widget( 'WP_Widget_Archives', 'dropdown=1' ); ?>
<?php the_widget( 'WP_Widget_Tag_Cloud' ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'publish' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php edit_post_link( __( 'Edit', 'publish' ), '<footer class="entry-meta"><span class="edit-link">', '</span></footer>' ); ?>
</article><!-- #post-<?php the_ID(); ?> -->
<?php endwhile; // end of the loop. ?>
</div>
<!-- #content .site-content -->
</div><!-- #primary .content-area -->
<?php get_sidebar(); ?>
<?php get_footer(); ?>

59
style.css Normal file
View file

@ -0,0 +1,59 @@
/*
Theme Name: Independent Snipette
Author: Badri Sunderarajan
Author URI: https://medium.com/@badrihippo
Description: Snipette extensions to the "Independent Publisher" theme
Template: independent-publisher
Version: 0.1
License: GNU GPLv3
License URI: http://www.gnu.org/copyleft/gpl.html
Tags: light, white, blue, two-columns, left-sidebar, flexible-width, custom-background, custom-colors, custom-menu, editor-style, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
Based on "Independent Publisher Child Theme" by raamdev
https://github.com/raamdev/independent-publisher-child-theme/
*/
/* =Imports styles from the parent theme
-------------------------------------------------------------- */
@import url('../independent-publisher/style.css');
/* =Theme customization starts here. Add your own custom styles.
-------------------------------------------------------------- */
/* Uncomment this style definition to hide the green bar on Quote Formatted posts: */
/*
.format-quote blockquote {
border-left: none;
padding-left: 0;
}
*/
/* Uncomment this style definition to use the original, Mac-specific font stack */
/*
h1,
h2,
h3,
h4,
h5,
h6,
.pinglist,
#taglist,
.comment-form-author label,
.comment-form-email label,
.comment-form-url label,
.comment-form-comment label,
.comment-form-subscriptions label,
.comment-form-reply-title {
font-family: "Myriad Pro","Lucida Grande","Lucida Sans Unicode","Lucida Sans",Geneva,Verdana,sans-serif;
}
*/
/* Uncomment this style definition to use a long dash in ```<cite>```: */
/*
blockquote cite:before {
content: "\2014 \0020";
}
*/