Giter VIP home page Giter VIP logo

theme's Introduction

Tonik — WordPress Starter Theme

The develop branch tracks starter development and it's not a stable code. If you want a stable version, use the master branch or one of the latest releases.

Build Status Packagist license

Tonik is a WordPress Starter Theme which aims to modernize, organize and enhance some aspects of WordPress theme development.

Take a look at what is waiting for you:

Requirements

Tonik Starter Theme follows WordPress recommended requirements. Make sure you have all these dependences installed before moving on:

Documentation

Comprehensive documentation of the starter is available at http://labs.tonik.pl/theme/

Contributing

Great that you are considering supporting the project. You have a lot of ways to help us grow. We appreciate all contributions, even the smallest.

  • Report an issue
  • Propose a feature
  • Send a pull request
  • Star project on the GitHub
  • Tell about project around your community

License

The Tonik Starter Theme is licensed under the MIT license.

theme's People

Contributors

albinhubsch avatar crissoca avatar jedrzejchalubek avatar simonvomeyser avatar zungx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

theme's Issues

Proper way to assign a custom template to a page in the CMS?

By default, there is no "Template" drop-down in the Page Attributes section when editing a page in the admin.

If I wanted to create a new template, let's say Homepage Template, what's the proper way to do that in Tonik?

I can create my template in the root of the theme that contains:

<?php
    /* Template Name: Homepage */
?>

but I feel like that's going against the whole templating system that Tonik uses. Is there another approach that I should be thinking about?

Thanks.

Theme to .zip command in cli

From the cli it would be nice to be able to create a theme.zip that can be distributed to clients or hosting of choice.

something like vendor/bin/tonik make:zip that runs npm run prod and then zips all theme file to a ready to share zip file.

Chrome Devtools Workspaces/Persistence not mapping resources folder

For some reason the Chrome devtools Workspaces/Persistence is not working with this theme. It automaps all the files in the public folder but none of the assets in the resources folder.

I realize this issue may not be related to the theme, but this works with all the other projects I work on so I'm wondering if anybody has any experience with this or ideas to fix.
screen shot 2017-12-14 at 2 51 12 pm

Yarn over NPM

Is there a possibility to use Yarn over NPM in a future iteration? Yarn is exceptionally fast to load dependencies.

Change namespace prefix and add unique namespace to templates controllers

Theme main namespace needs to be changed to Tonik\Theme (there is still an easy way to change it with CLI).

Top level template controllers need to receive their own namespaces so internal functions will be encapsulated and easy to reference.

<?php

// @ index.php
namespace Tonik\Theme\Index;

Preserve subdirectories for images in webpack output

I created a folder called svg inside of my images folder, but when webpack compiles it into the public folder, all of the images get flattened into that one images folder.

Is there something we can add to the webpack output object:

image: { filename: 'images/[name].[ext]' },

to be able to preserve those subdirectories?

Thanks!

WordPress Coding Standards

Is there any reason to not be following the WPCS? At least the PHP ones?

Honest question. Not trying to buy any flame war or something like that 😃

If you decide to adopt them, I could help because I'm very keen to adopt your framework on a future project and I could do this in between.

Enqueueing scripts from CDN

How can i register/enqueue scripts from a CDN?

When i try this below, i get:
"
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in ../wp-includes/class.wp-dependencies.php on line 344

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0"

wp_register_script( 'scrollbar', 'https://cdn.jsdelivr.net/jquery.mcustomscrollbar/3.0.6/jquery.mCustomScrollbar.concat.min.js', null, null, true );
wp_enqueue_script('scrollbar');

Syntax error when activate a theme

Hello,

I followed the doc to install theme, i have the WP-CLI installed too but when i try to activate theme with = wp theme activate my_theme i got following error

"Error: Error establishing a database connection. This either means that the username and password information in your wp-config.php file is incorrect or we can’t contact the database server at localhost. This could mean your host’s database server is down."

My server is not down, i go to the wordpress backend, trying to activate manually theme and i got following error also :

( ! ) Parse error: syntax error, unexpected '}', expecting \\ (T_NS_SEPARATOR) in /app/public/wp-content/themes/starter-theme/src/helpers.php on line 3

Someone can help me?

Thanks

Problem with DIRECTORY_SEPARATOR.

I use windows OS and after install theme, i found a problem with DIRECTORY_SEPARATOR constants, when theme use asset_path function, it output the url with no separator.

Line 70, ASSETS.php:
$uri . DIRECTORY_SEPARATOR . $this->getRelativePath();

http://prntscr.com/hugboe

Are there any concerns of future-proofing/compatibility?

I am using this theme to develop a large web-app and love it so far. As i get further and further along I realize that there are many things going on in the background that change how WP functions (theme init, the loading of the template files etc).

Is there any concern that future WP updates/functionality might break if the project stops being maintained?

Thanks

Concatenate / Combine JS

I am new to webpack and i'm trying to figure out to to concat/combine JS files. I see a few plugins that can be used but I cant figure out how to fit it into the Tonik workflow. Any guidance would be appreciated!

Refactor docblocks of templates actions and filters

Docblocks of actions and filters in .tpl.php files should help find proper function hooked to this hooks. We should borrow a solution from WooCommerce where each do_action receive docblock with a list of @hooked property and function name.

/**
 * Functions hooked into `theme/index/header` action.
 *
 * @hooked Theme\Index\render_header - 10
 */
 do_action('theme/index/header');

Docblocks on functions should point to the template file with action where they are hooked.

/**
 * Renders header.
 *
 * @see resources/templates/index.tpl.php
 */
function render_header()
{
    //
}
add_action('theme/index/header', 'Theme\Index\render_header');
``

Install dependencies in custom paths

Hello! I was having difficulties installing Redux Framework inside wordpress plugins directory and keep tonik/gin inside vendor, so I made some minor changes to achieve this, which I'm Pull Requesting right now...
#56
tonik/gin#7

Question: Speeding up deployments?

I'm just looking at some ways to speed up the deployments, and I noticed in the docs and in the travis.yml file you are running both:

npm run development
npm run production

Is there a reason you need to run both? If you wanted to deploy to a production / staging environment it should be fine to just run npm run production correct?

Thanks!

Move jQuery to the footer by default

Add wp_default_scripts action in src/Http/assets.php which moves jquery lib to the footer.

// Moves jQuery to the footer on frontend.
add_action('wp_default_scripts', function ($wp_scripts) {
    if ( ! is_admin()) {
        $wp_scripts->add_data('jquery', 'group', 1);
        $wp_scripts->add_data('jquery-core', 'group', 1);
        $wp_scripts->add_data('jquery-migrate', 'group', 1);
    }
});

Starter should be shipped without any front-end boilerplate by default

We plan to remove current front-end stack on Foundation, so the starter will ship without any by default.

A developer will have the ability to spin different boilerplates on starter initializing with our CLI. This gives us the option to introduce various boilerplates (foundation, bootstrap, bulma etc.) and still give space for those who don't want any.

Custom post type helper class doesn't work

I am using https://github.com/jjgrainger/wp-custom-post-type-class . It works in every way except for the "has_archive" option is ignored. I found a similar issue in their repo that i think may be the problem (linked below). Is there any way i can use this class in this theme?

"I suspect the problem is that I initialize a theme using an init class,
hooked to after_theme_setup. Putting the class inside a class was probably
creating unpredictable results."

"new CPT() should not be included in a hook, it sets up the hooks in __construct, so if you are using CPT in a hook then it's probably not working at all and being loaded too late."

jjgrainger/wp-custom-post-type-class#26

Move forward to use ES6

Import bootstrap scripts as module and compile separately with webpack.

// ./resources/assets/js/bootstrap.js
import Bootstrap from 'bootstrap-sass';

// ./gulpfile.js
mix.webpack('bootstrap.js')

Prepare resources/assets/js/theme.js boilerplate file and compile with webpack too.

// gulpfile.js
mix.webpack('theme.js')

Enqueue new files in src/Http/assets.php by default.

wp_enqueue_script('bootstrap', asset_path('js/bootstrap.js'), ['jquery'], null, true);
wp_enqueue_script('theme-scripts', asset_path('js/theme.js'), ['bootstrap'], null, true);

new Config instance is binded twice when located config was found

On theme bootstrapping, new Config instance is bonded twice when located config file was found (https://github.com/tonik/theme/blob/master/bootstrap/theme.php#L28-L36).
$config variable need to be overwritten with merged one when this happens.

$config = require __DIR__ . '/../config/theme.php';

if ($locatedConfig = locate_template('config/theme.php', false, false)) {
    $config = array_merge_recursive($config, require $locatedConfig);
}

$theme->bind('config', new Tonik\Gin\Foundation\Config($config));

[SOLVED] HTTP Error 500

Hi there

I'm having an issue with Tonic. I'm following this tutorial : http://labs.tonik.pl/theme/docs/installation/

Everything runs smooth, but when I try to activate the theme, it become HTTP error 500, and I cannot open wp-admin. So I have to delete tonic theme folder.

I'm trying to increase PHP memory limit, but still no luck. I'm using MAMP by the way, with PHP 7.1.6.

Any help would be greatly appreciated

Thanks!

[UPDATE]

After activate WP_DEBUG and WP_DEBUG_LOG, I get this error instead :

Parse error: syntax error, unexpected '}', expecting \\ (T_NS_SEPARATOR) in /Applications/MAMP/htdocs/web/wordpress/wp-content/themes/tonictheme/src/helpers.php on line 3

How do I import fonts?

I'm trying to import the fonts from app.scss @import "~material-design-icons/iconfont/material-icons";

but getting the error that no font files found:
ERROR in ./~/css-loader?{"sourceMap":true}!./~/postcss-loader?{"sourceMap":true}!./~/sass-loader/lib/loader.js?{"sourceMap":true}!./resources/assets/sass/app.scss Module not found: Error: Can't resolve './MaterialIcons-Regular.eot' in 'c:\OpenServer\domains\project.dev\web\app\themes\tonik\resources\assets\sass'
and so for the every file.

May I ask for a help, what is the correct way of importing fonts?

Refactor service provider

Hi @jedrzejchalubek

My wordpress skill maybe not well, but i like this starter theme and i want contribute that.
I have idea. If you accept, i will do it.

Create new folder:

  • Services: This folder contain all class service.

Example:
PostService.php -> this class management post
NotificationService.php -> this class management push notification to mobile, slack,...
ApiService.php -> this class for build rest api
...

  • Providers: This folder contain all class will register, init services.

Example:
PostServiceProvide.php -> we are init PostService here
ApiServiceProvide.php -> we are init ApiService here
...

And we register all ServiceProvide in theme.php
example:

$theme->register(App\Providers\PostServiceProvide::class);
$theme->register(App\Providers\ApiServiceProvide::class);

And package tonik/gin we will refactor binding, resolved method with class not a function.
In the feature we can using for Dependency Injection

Sorry my english not well :(

browsersync stuck loading localhost:3000

Mac OS X Sierra, running Local by Flywheel as the local dev environment.

npm run watch opens a browser tab at localhost:3000 but never loads.

Can access localhost:3001 to reach browsersync ui

Can also access tonik.dev directly just fine.

Thoughts on how to debug browsersync issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.