Giter VIP home page Giter VIP logo

chrisblakley / nebula Goto Github PK

View Code? Open in Web Editor NEW
139.0 10.0 36.0 78.02 MB

Nebula is a WordPress theme framework that focuses on enhancing development. The core features of Nebula make it a powerful tool for designing, developing, and analyzing WordPress websites consistently, yet its deliberately uncomplicated code syntax also serves as a learning resource for programmers themselves.

Home Page: https://nebula.gearside.com

License: GNU General Public License v2.0

PHP 68.14% CSS 0.05% JavaScript 23.11% SCSS 8.70%
wordpress theme child-theme google-analytics hubspot wordpress-theme-framework

nebula's Introduction

Nebula readme icon

Nebula is a WordPress theme framework that focuses on enhancing development

The core features of Nebula make it a powerful tool for designing, developing, and analyzing WordPress websites consistently, but its deliberately uncomplicated code syntax also serves as a learning resource for programmers themselves.

GitHub release (latest SemVer) GitHub commits since latest release (by SemVer) GitHub last commit CodeQL Codacy Badge CodeFactor

Nebula screenshot

Getting Started

These instructions will get Nebula setup to its recommended baseline.

Requirements & Recommendations

Nebula follows WordPress recommended requirements, and does not require any additional server software. Browsers with >1% market share are officially supported.

To take full advantage of Nebula's features, the following are recommended:

  • WordPress Latest
  • PHP 7.4+
  • MySQL 5.6+
  • SSL

Prerequisites

Download and install WordPress.

Installation & Setup

Nebula installation

  1. Download the .zip file of the Nebula theme. Upload to the WordPress /wp-content/themes/ directory.
  2. Activate the Nebula theme and run the automated initialization.
  3. This will automatically install and activate the Nebula Child theme.
  4. It is recommended to rename the child theme (in /assets/scss/style.scss and the directory name itself).
  5. Create a /assets/img/meta/ directory in the child theme (or copy it from the Nebula parent).
  6. Install and activate recommended plugins including the optional Nebula Companion plugin.
  7. Customize Nebula Options (including enabling Sass if desired)

Documentation

Comprehensive documentation is available at https://nebula.gearside.com/ along with a testing checklist and launch guide.

Performance

Performance data is updated automatically every hour. Your performance may vary depending on your hosting, plugins, and many other variables. This graphic is to simply illustrate Nebula's performance capabilities.

Built Using

nebula's People

Contributors

alexeyan avatar chrisblakley avatar imgbotapp avatar jefcollier avatar paragonie-security avatar patmcneil avatar patphg avatar phgdigital avatar rubengc avatar terencehoverter avatar xcibe95x 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

nebula's Issues

Make sure WYSIWYG content images have proper margin

Something like:

div.entry-content img {margin: 0 24px 12px 24px;}
div.entry-content img.alignleft {display: inline; margin-left: 0; margin-right: 24px;}
div.entry-content img.alignright {display: inline; margin-left: 24px; margin-right: 0;}
div.entry-content img.aligncenter {clear: both; display: block; margin-left: auto; margin-right: auto;}

These may be present (or close to it) lower in the style.css under the /* LAYOUT */ comment, but could be improved.

Thoughts on localization?

Should the Nebula template use __(...) and _e(...) for translations? All of our sites are only in English, so I think we could speed development up in general if we remove language scripts, but it's also not necessarily hurting anything.

Currently, only hard-coded text is wrapped in these scripts, so even if we wanted to localize text, we'd have some major work to do and the tags in question here are the tip of the iceberg.

Any thoughts?

nebula_the_excerpt() with pre-defined Post ID

Allow a post ID to be passed to nebula_the_excerpt so it can be used outside the loop if needed.

Here's something to start:

function nebula_the_excerpt( $more=false, $length=20, $hellip=false, $postID=false ) {
    $the_post = get_post($postID);

    if ( $postID ) { //Find a better way to pull the post_content without formatting. strip_tags() isn't working properly, and can't get_the_excerpt() using post ID...
        //if the post ID has an excerpt
        //else try the post ID content
        $string = $the_post->post_content;
    } else {
        if ( get_the_excerpt() ) {
            $string = strip_tags(get_the_excerpt(), '<p>');
        } else {
            $string = strip_tags(get_the_content(), '<p>');
        }
    }
    $string = string_limit_words($string, $length);
    if ( $hellip ) {
        if ( $string[1] == 1 ) {
            $string[0] .= '&hellip; ';
        }
    }
    if ( isset($more) && $more != '' ) {
        $string[0] .= ' <a class="nebula_the_excerpt" href="' . get_permalink($postID) . '">' . $more . '</a>';
    }
    return $string[0];
}

Additionally, allow a "d" to be used to for any value (except $postID) to tell nebula_the_excerpt() to use the global default value for that parameter. Maybe there is a better way to do this? My goal is to allow a user to designate a Post ID without needing to also designate a $length and $hellip (which would prevent making global changes to their theme more difficult).

HTML5 background video example

Add an example of proper (and experimental) usage of html5 video as a background element. Possibly use video.js as an optional library.

Add doubletaptogo.js support (for when not using mmenu)

Add doubletaptogo.js to /js/libs/ and call it (commented out) in the footer.php (can be deferred, place it above main.js).

Since this js file is so small, consider moving it inside main.js as a function. @jefphg: may bounce this off you.

<script src="<?php bloginfo('template_directory');?>/js/libs/doubletaptogo.js" defer></script>

This function will prevent touch-based devices from following an href when the parent link is actually a dropdown menu. Once open, it will allow the link to work on a second click. Call it on the parent element (typically an LI)- this line should work in all cases.

jQuery('#primarynav .menu-item-has-children').doubleTapToGo();

Here is the full function:

;(function(jQuery, window, document, undefined){
    jQuery.fn.doubleTapToGo = function(params){
        if( !('ontouchstart' in window) &&
            !navigator.msMaxTouchPoints &&
            !navigator.userAgent.toLowerCase().match( /windows phone os 7/i ) ) return false;

        this.each(function(){
            var curItem = false;

            jQuery(this).on( 'click', function(e){
                var item = jQuery(this);
                if( item[0] != curItem[0] ){
                    e.preventDefault();
                    curItem = item;
                }
            });

            jQuery( document ).on( 'click touchstart MSPointerDown', function( e ){
                var resetItem = true,
                    parents   = $( e.target ).parents();

                for( var i = 0; i < parents.length; i++ )
                    if( parents[ i ] == curItem[ 0 ] )
                        resetItem = false;

                if( resetItem )
                    curItem = false;
            });
        });
        return this;
    };
})(jQuery, window, document);

Add Jef's simple Gumby modal JS trigger

Add Jef's on click trigger for Gumby modals (with my slight modification) to main.js but also look into the Gumby docs to see if we can eventually not need the mod.

Add a "banner" to the Dashboard

Customize the WP Admin Dashboard to include a "banner" (using the Welcome Message) for quick access to useful links.

The screenshot is overkill, but the idea is there. We should also include "Designed and developed by Pinckney Hugo Group" in it with a link back to us.
screen shot 2014-04-05 at 11 03 27 am

Viewport dimensions object for JS

Returns an object of the viewport dimensions. Could be useful- add an additional call to it in the resize function.

viewport = updateViewportDimensions();

function updateViewportDimensions() {
    var w=window,d=document,e=d.documentElement,g=d.getElementsByTagName('body')[0],x=w.innerWidth||e.clientWidth||g.clientWidth,y=w.innerHeight||e.clientHeight||g.clientHeight;
    return { width:x,height:y }
}

Enhance post meta section

Wrap the post meta in the stylized


lines.

Add the author name to the post meta section.

Set the font size to be 12px for post meta (and lighter grey than #444 too).

Add Schema.org Tags globally

May be a slow process, but we should consider adding schema.org tags globally to Nebula to have from the get-go.

Add event tracker for bad login attempt

Send a GA event using login.js when a user enters an incorrect password. Maybe using a setTimeout or something? Use the username and IP as the action and label.

Also track on password resets (intent if we have to).

Related posts function... useful?

Might be useful for sites with blogs to automatically cross-link pages. This just does a query for other posts with similar tags.

function bones_related_posts() {
    echo '<ul id="bones-related-posts">';
    global $post;
    $tags = wp_get_post_tags( $post->ID );
    if($tags) {
        foreach( $tags as $tag ) {
            $tag_arr .= $tag->slug . ',';
        }
        $args = array(
            'tag' => $tag_arr,
            'numberposts' => 5, /* you can change this to show more */
            'post__not_in' => array($post->ID)
        );
        $related_posts = get_posts( $args );
        if($related_posts) {
            foreach ( $related_posts as $post ) : setup_postdata( $post ); ?>
                <li class="related_post"><a class="entry-unrelated" href="<?php the_permalink() ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
            <?php endforeach; }
        else { ?>
            <?php echo '<li class="no_related_post">' . __( 'No Related Posts Yet!', 'bonestheme' ) . '</li>'; ?>
        <?php }
    }
    wp_reset_postdata();
    echo '</ul>';
} /* end bones related posts function */

Consider initializing Google Fonts from functions.php

Instead of header.php or styles.css. What are the pros/cons? Also, check to see if gumby.css is loading Open Sans.

function web_fonts() {
  wp_register_style('googleFonts', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800');
  wp_enqueue_style( 'googleFonts');
}
add_action('wp_print_styles', 'web_fonts');

Add conditional comment for IE for gt IE 9

Test to see if this line triggers for just IE or if other browsers are affected. Also does this trigger for just IE 10? or does IE 11 fall into this?

<!--[if gt IE 9 ]><html <?php language_attributes(); ?> class="no-js ie ie10 lte-ie10 lte-ie10 lt-ie11"><![endif]-->

Loop is broken

Parse error: syntax error, unexpected ':' in /home3/cblakley/public_html/nebula/wp-content/themes/WP-Nebula-master/loop.php on line 36

Need to fix asap. Can be tested on a search result page easiest.

Check the sizing of Facebook share thumbnails

Double check the size of Facebook sharing thumbnails since they made the design update to the feed. Images should be minimum of 200x200, but let's make sure we use an appropriate size so they don't get scaled up.

Don't want to make them too big either because we should be able to design at the expected size (for readability, etc.).

Additional General Event Trackers

Additional default event trackers here. Post requests or ideas here.

Window Resizes

//on ready, var is the window size
//after resize complete (using our waitforfinalevent), send event "resize" "from XXXXpx to XXXpx"
//after event, change initial var to end size

Print Intent (clean this up significantly first)

try{
(function() {
var afterPrint = function() {
ga('send', 'event', 'Print Intent', document.location.pathname); //for Universal GA
};
if (window.matchMedia) {
var mediaQueryList = window.matchMedia('print');
mediaQueryList.addListener(function(mql) {
if (!mql.matches)
afterPrint();
});
}
window.onafterprint = afterPrint;
}());
} catch(e) {}

External Links

$("a[rel*='external']").click(function(){ //change to .on('click')
//send event here
});

nebula_the_excerpt needs to be able to get the excerpt by post ID

Currently we're just pulling the post_content from the designated post ID inside nebula_the_excerpt(). This works, but I want to pull the excerpt itself if it exists for that post.

get_the_excerpt() does not accept parameters. Currently I've got:

$the_post = get_post($postID);
$string = $the_post->post_content;

Is there an equivalent to post_content for the excerpt?

Set "defer" and "async" as PHP variables in functions

Using a conditional, detect "?debug" like we do in the footer now, but inside the false, set $defer and $async as strings. Then, in the footer, we only need to call each script tag once!

if ( array_key_exists('debug', $_GET) ) {
    $defer = '';
    $async = '';
} else {
    $defer = 'defer';
    $async = 'async';
}

Then in the header/footer for script tags (for appropriate ones), call them like this:

<script type='text/javascript' src="<?php bloginfo('template_directory');?>/js/libs/modernizr.custom.42059.js" <?php echo $defer; ?>></script>

nebula_the_excerpt() Needs to skip embedded content somehow

For example, when the excerpt is empty, the content is used, but when this has dynamic content like a Youtube player embedded within the first X words of the post, it will be generated on the listing page where nebula_the_excerpt() is used.

Somehow we need to detect any HTML code used in the content and strip it out. Furthermore, we also can't echo the raw code either.

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.