Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
v1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
anteprimorac committed Aug 8, 2016
1 parent 37d5d79 commit 54e7549
Show file tree
Hide file tree
Showing 16 changed files with 622 additions and 317 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [1.0.8] - 2016-08-08
### Fixed
- Fix some code missing in last version

## [1.0.7] - 2016-07-29
### Fixed
- Fix WP editor read more tag image height (thanks @josephbydeign)
Expand Down
3 changes: 3 additions & 0 deletions gulpconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
],
"source/admin/less/pine-editor.less": [
"admin/css/pine-editor.css"
],
"source/admin/less/admin-page.less": [
"admin/css/pine-admin-page.css"
]
}
}
Expand Down
12 changes: 6 additions & 6 deletions inc/customizer-controls.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function __construct( $manager, $id, $args = array() ) {
* @since 1.0
*/
public function enqueue() {
wp_enqueue_style( 'pine-customize-control-layout' );
wp_enqueue_script( 'pine-customize-control-layout' );
wp_enqueue_style( 'pine-customize-control-layout', get_template_directory_uri() . '/admin/css/pine-customize-control-layout.css', array( 'customize-controls' ), '20150610', 'all' );
wp_enqueue_script( 'pine-customize-control-layout', get_template_directory_uri() . '/admin/js/pine-customize-control-layout.js', array( 'customize-controls', 'jquery' ), '20140806', true );
}

/**
Expand Down Expand Up @@ -152,8 +152,8 @@ public function __construct( $manager, $id, $args = array() ) {
* @since 1.0
*/
public function enqueue() {
wp_enqueue_style( 'pine-customize-control-color-scheme' );
wp_enqueue_script( 'pine-customize-control-color-scheme' );
wp_enqueue_style( 'pine-customize-control-color-scheme', get_template_directory_uri() . '/admin/css/pine-customize-control-color-scheme.css', array( 'customize-controls' ), '20150610', 'all' );
wp_enqueue_script( 'pine-customize-control-color-scheme', get_template_directory_uri() . '/admin/js/pine-customize-control-color-scheme.js', array( 'customize-controls', 'jquery' ), '20150610', true );
}

/**
Expand Down Expand Up @@ -254,8 +254,8 @@ public function __construct( $manager, $id, $args = array() ) {
* @since 1.0
*/
public function enqueue() {
wp_enqueue_style( 'pine-customize-control-social-buttons' );
wp_enqueue_script( 'pine-customize-control-social-buttons' );
wp_enqueue_style( 'pine-customize-control-social-buttons', get_template_directory_uri() . '/admin/css/pine-customize-control-social-buttons.css', array( 'customize-controls' ), '20150610', 'all' );
wp_enqueue_script( 'pine-customize-control-social-buttons', get_template_directory_uri() . '/admin/js/pine-customize-control-social-buttons.js', array( 'customize-controls', 'jquery' ), '20150610', true );
}

/**
Expand Down
53 changes: 29 additions & 24 deletions inc/customizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,39 @@ function pine_customize_register( $wp_customize ) {
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';

$sanitize_header_choice = new Pine_Sanitize_Select( array( 'logo', 'title' ), 'title' );
if ( ! function_exists( 'the_custom_logo' ) ) {
$sanitize_header_choice = new Pine_Sanitize_Select( array( 'logo', 'title' ), 'title' );

$wp_customize->add_setting( 'pine_header', array(
'default' => 'title',
'transport' => 'postMessage',
'sanitize_callback' => array( $sanitize_header_choice, 'callback' ),
) );
$wp_customize->add_setting( 'pine_header', array(
'default' => 'title',
'transport' => 'postMessage',
'sanitize_callback' => array( $sanitize_header_choice, 'callback' ),
) );

$wp_customize->add_control( 'pine_header', array(
'label' => __( 'Display', 'pine' ),
'section' => 'title_tagline',
'type' => 'select',
'choices' => array(
'logo' => __( 'Logo', 'pine' ),
'title' => __( 'Site Title', 'pine' ),
),
) );
$wp_customize->add_control( 'pine_header', array(
'label' => __( 'Display', 'pine' ),
'section' => 'title_tagline',
'type' => 'select',
'choices' => array(
'logo' => __( 'Logo', 'pine' ),
'title' => __( 'Site Title', 'pine' ),
),
) );

$wp_customize->add_setting( 'pine_header_logo', array(
'default' => get_template_directory_uri() . '/img/content/portfolio.jpg',
'transport' => 'postMessage',
'sanitize_callback' => 'esc_url_raw',
) );
$wp_customize->add_setting( 'pine_header_logo', array(
'default' => get_template_directory_uri() . '/img/content/portfolio.jpg',
'transport' => 'postMessage',
'sanitize_callback' => 'esc_url_raw',
) );

$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'pine_header_logo', array(
'label' => __( 'Upload a logo', 'pine' ),
'section' => 'title_tagline',
) ) );
$wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, 'pine_header_logo', array(
'label' => __( 'Upload a logo', 'pine' ),
'section' => 'title_tagline',
) ) );
} else {
$wp_customize->get_setting( 'custom_logo' )->default = get_template_directory_uri() . '/img/content/portfolio.jpg';
$wp_customize->selective_refresh->get_partial( 'custom_logo' )->render_callback = 'pine_custom_logo';
}

$sections = $wp_customize->sections();

Expand Down
79 changes: 79 additions & 0 deletions inc/extras.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,82 @@ function pine_category_transient_flusher() {
}
add_action( 'edit_category', 'pine_category_transient_flusher' );
add_action( 'save_post', 'pine_category_transient_flusher' );

/**
* Portfolio post type
*
* @return array
*/
function pine_get_portfolio_post_type() {
$pine_portfolio_post_type = array( 'jetpack-portfolio' );

/**
* Filter portfolio post type
*
* @param array $pine_portfolio_post_type Default post types.
*/
return (array) apply_filters( 'pine_portfolio_post_type', $pine_portfolio_post_type );
}

/**
* Portfolio posts per page
*
* @return integer
*/
function pine_get_portfolio_posts_per_page() {
$pine_portfolio_posts_per_page = (int) get_option( 'jetpack_portfolio_posts_per_page', get_option( 'posts_per_page', 9 ) );

/**
* Filter portfolio number of posts per page
*
* @param integer $pine_portfolio_posts_per_page Default number of posts per page.
*/
return (int) apply_filters( 'pine_portfolio_posts_per_page', $pine_portfolio_posts_per_page );
}

/**
* Portfolio taxonomy
*
* @return array
*/
function pine_get_portfolio_taxonomy() {
$pine_portfolio_taxonomy = array( 'jetpack-portfolio-type' );

/**
* Filter portfolio taxonomy
*
* @param array $pine_portfolio_taxonomy Default taxonomies.
*/
return (array) apply_filters( 'pine_portfolio_taxonomy', $pine_portfolio_taxonomy );
}

/**
* Upgrade theme logo
*/
function pine_logo_upgrade() {
$upgraded = absint( get_theme_mod( 'pine_logo_upgraded', 0 ) );

// Check is site logo already upgraded.
if ( 1 === $upgraded ) {
return;
}

$pine_header = get_theme_mod( 'pine_header' );
$pine_header_logo = get_theme_mod( 'pine_header_logo' );

/* Update header_text value. */
if ( 'title' === $pine_header ) {
set_theme_mod( 'header_text', 1 );
}
if ( 'logo' === $pine_header ) {
set_theme_mod( 'header_text', 0 );
}

/* Update custom_logo value. */
if ( ! empty( $pine_header_logo ) ) {
set_theme_mod( 'custom_logo', $pine_header_logo );
}

set_theme_mod( 'pine_logo_upgraded', 1 );
}
add_action( 'admin_init', 'pine_logo_upgrade' );
71 changes: 54 additions & 17 deletions inc/template-tags.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,30 +110,67 @@ function pine_thumbnail_src( $size = 'pine-full' ) {
}
endif;

/**
* Display custom logo
*/
function pine_custom_logo() {
$custom_logo_id = get_theme_mod( 'custom_logo', get_template_directory_uri() . '/img/content/portfolio.jpg' );

if ( $custom_logo_id ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="custom-logo-link" rel="home" itemprop="url">
<?php if ( is_numeric( $custom_logo_id ) ) :
echo wp_get_attachment_image( $custom_logo_id, 'full', false, array(
'class' => 'custom-logo',
'itemprop' => 'logo',
) );
else : ?>
<img src="<?php echo esc_url( $custom_logo_id ); ?>" class="custom-logo" itemprop="logo" />
<?php endif; ?>
</a>
<?php elseif ( is_customize_preview() ) : ?>
<a href="<?php echo esc_url( home_url( '/' ) ); ?>" class="custom-logo-link" style="display:none;"><img class="custom-logo"/></a>
<?php endif;
}

if ( ! function_exists( 'pine_logo' ) ) :
/**
* Display pine logo
*/
function pine_logo() {
$pine_header = get_theme_mod( 'pine_header', 'title' );
if ( function_exists( 'the_custom_logo' ) ) :
pine_logo_upgrade();

$pine_header_logo_default = get_template_directory_uri() . '/img/content/portfolio.jpg';
$pine_header_logo = get_theme_mod( 'pine_header_logo' );
if ( empty( $pine_header_logo ) ) {
$pine_header_logo = $pine_header_logo_default;
}
$header_text = get_theme_mod( 'header_text', 1 );

if ( 'title' === $pine_header || is_customize_preview() ) : ?>
<h1 class="logo site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1><!-- /.logo -->
<?php endif; ?>
<?php if ( 'logo' === $pine_header || is_customize_preview() ) : ?>
<h1 class="logo site-logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img class="site-logo__image" src="<?php echo esc_url( $pine_header_logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
<?php if ( is_customize_preview() ) : ?>
<img class="site-logo__image default" src="<?php echo esc_url( $pine_header_logo_default ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" style="display: none" />
<?php endif; ?>
</a></h1><!-- /.logo -->
<?php
if ( 0 === $header_text ) : ?>
<h1 class="logo site-logo"><?php pine_custom_logo(); ?></h1>
<?php endif;

if ( 1 === $header_text ) : ?>
<h1 class="logo site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1><!-- /.logo -->
<?php endif;
else :
$pine_header = get_theme_mod( 'pine_header', 'title' );

$pine_header_logo_default = get_template_directory_uri() . '/img/content/portfolio.jpg';
$pine_header_logo = get_theme_mod( 'pine_header_logo' );
if ( empty( $pine_header_logo ) ) {
$pine_header_logo = $pine_header_logo_default;
}

if ( 'title' === $pine_header || is_customize_preview() ) : ?>
<h1 class="logo site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1><!-- /.logo -->
<?php endif;

if ( 'logo' === $pine_header || is_customize_preview() ) : ?>
<h1 class="logo site-logo"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
<img class="site-logo__image" src="<?php echo esc_url( $pine_header_logo ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" />
<?php if ( is_customize_preview() ) : ?>
<img class="site-logo__image default" src="<?php echo esc_url( $pine_header_logo_default ); ?>" alt="<?php echo esc_attr( get_bloginfo( 'name' ) ); ?>" style="display: none" />
<?php endif; ?>
</a></h1><!-- /.logo -->
<?php
endif;
endif;
}
endif;
Expand Down
12 changes: 12 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=759670
// for the documentation about the jsconfig.json format
"compilerOptions": {
"target": "es5",
"module": "es6",
"allowSyntheticDefaultImports": true
},
"exclude": [
"node_modules"
]
}
92 changes: 47 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,50 @@
{
"name": "pine",
"version": "1.0.1",
"description": "Pine is free minimalist WordPress portfolio theme created for people who want to show their work on simple and creative way. Pine is made for a freelancers, designers or smaller agencies who are looking for elegant, professional and minimal look.",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/themejack/pine.git"
},
"author": "Slicejack",
"license": "MIT",
"devDependencies": {
"autoprefixer": "^6.0.3",
"browserslist": "0.x.x",
"css-mqpacker": "^4.0.0",
"gulp": "3.9.x",
"gulp-autoprefixer": "2.x.x",
"gulp-include": "1.x.x",
"gulp-less": "3.x.x",
"gulp-minify-css": "1.x.x",
"gulp-plumber": "1.x.x",
"gulp-postcss": "^6.0.1",
"gulp-rename": "1.x.x",
"gulp-uglify": "1.x.x",
"gulp-util": "3.x.x",
"postcss-log-warnings": "^0.3.1"
},
"name": "pine",
"version": "1.0.1",
"description": "Pine is free minimalist WordPress portfolio theme created for people who want to show their work on simple and creative way. Pine is made for a freelancers, designers or smaller agencies who are looking for elegant, professional and minimal look.",
"main": "gulpfile.js",
"scripts": {
"prepare": "npm run prepare:dependencies && npm run build:all",
"prepare:all": "npm run prepare:dependencies && npm run build:all",
"prepare:dependencies": "npm install",
"build": "npm run build:less && npm run build:less:admin && npm run build:js && npm run build:js:vendors && npm run build:js:customizer && npm run build:js:admin",
"build:all": "npm run build:less && npm run build:less:admin && npm run build:js && npm run build:js:vendors && npm run build:js:customizer && npm run build:js:admin",
"build:less": "node ./node_modules/gulp/bin/gulp.js less --target=default",
"build:less:admin": "node ./node_modules/gulp/bin/gulp.js less --target=admin",
"build:js": "node ./node_modules/gulp/bin/gulp.js js",
"build:js:default": "node ./node_modules/gulp/bin/gulp.js js --target=default",
"build:js:vendors": "node ./node_modules/gulp/bin/gulp.js js --target=vendors",
"build:js:customizer": "node ./node_modules/gulp/bin/gulp.js js --target=customizer",
"build:js:admin": "node ./node_modules/gulp/bin/gulp.js js --target=admin",
"gulp": "node ./node_modules/gulp/bin/gulp.js default",
"gulp:default": "node ./node_modules/gulp/bin/gulp.js default",
"gulp:watch": "node ./node_modules/gulp/bin/gulp.js watch"
}
"prepare": "npm run prepare:dependencies && npm run build:all",
"prepare:all": "npm run prepare:dependencies && npm run build:all",
"prepare:dependencies": "npm install",
"build": "npm run build:less && npm run build:less:admin && npm run build:js && npm run build:js:vendors && npm run build:js:customizer && npm run build:js:admin",
"build:all": "npm run build:less && npm run build:less:admin && npm run build:js && npm run build:js:vendors && npm run build:js:customizer && npm run build:js:admin",
"build:less": "node ./node_modules/gulp/bin/gulp.js less --target=default",
"build:less:admin": "node ./node_modules/gulp/bin/gulp.js less --target=admin",
"build:js": "node ./node_modules/gulp/bin/gulp.js js",
"build:js:default": "node ./node_modules/gulp/bin/gulp.js js --target=default",
"build:js:vendors": "node ./node_modules/gulp/bin/gulp.js js --target=vendors",
"build:js:customizer": "node ./node_modules/gulp/bin/gulp.js js --target=customizer",
"build:js:admin": "node ./node_modules/gulp/bin/gulp.js js --target=admin",
"gulp": "node ./node_modules/gulp/bin/gulp.js default",
"gulp:default": "node ./node_modules/gulp/bin/gulp.js default",
"gulp:watch": "node ./node_modules/gulp/bin/gulp.js watch",
"test": "npm run test:js",
"test:js": "npm run test:js:default",
"test:js:default": "node ./node_modules/jshint/dist/jshint.js ./source/js/scripts.js",
"test:js:customizer": "node ./node_modules/jshint/dist/jshint.js ./source/js/customizer.js"
},
"repository": {
"type": "git",
"url": "https://github.com/themejack/pine.git"
},
"author": "Slicejack",
"license": "MIT",
"devDependencies": {
"autoprefixer": "^6.0.3",
"browserslist": "0.x.x",
"css-mqpacker": "^4.0.0",
"gulp": "3.9.x",
"gulp-autoprefixer": "2.x.x",
"gulp-include": "1.x.x",
"gulp-less": "3.x.x",
"gulp-minify-css": "1.x.x",
"gulp-plumber": "1.x.x",
"gulp-postcss": "^6.0.1",
"gulp-rename": "1.x.x",
"gulp-uglify": "1.x.x",
"gulp-util": "3.x.x",
"jshint": "^2.9.2",
"postcss-log-warnings": "^0.3.1"
}
}
Loading

0 comments on commit 54e7549

Please sign in to comment.