Coder Social home page Coder Social logo

automattic / _s Goto Github PK

View Code? Open in Web Editor NEW
10.9K 730.0 3.1K 1.09 MB

Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.

Home Page: http://underscores.me/

License: GNU General Public License v2.0

PHP 33.79% JavaScript 3.50% CSS 38.36% SCSS 24.35%

_s's Introduction

Build Status

_s

Hi. I'm a starter theme called _s, or underscores, if you like. I'm a theme meant for hacking so don't use me as a Parent Theme. Instead try turning me into the next, most awesome, WordPress theme out there. That's what I'm here for.

My ultra-minimal CSS might make me look like theme tartare but that means less stuff to get in your way when you're designing your awesome theme. Here are some of the other more interesting things you'll find here:

  • A modern workflow with a pre-made command-line interface to turn your project into a more pleasant experience.
  • A just right amount of lean, well-commented, modern, HTML5 templates.
  • A custom header implementation in inc/custom-header.php. Just add the code snippet found in the comments of inc/custom-header.php to your header.php template.
  • Custom template tags in inc/template-tags.php that keep your templates clean and neat and prevent code duplication.
  • Some small tweaks in inc/template-functions.php that can improve your theming experience.
  • A script at js/navigation.js that makes your menu a toggled dropdown on small screens (like your phone), ready for CSS artistry. It's enqueued in functions.php.
  • 2 sample layouts in sass/layouts/ made using CSS Grid for a sidebar on either side of your content. Just uncomment the layout of your choice in sass/style.scss. Note: .no-sidebar styles are automatically loaded.
  • Smartly organized starter CSS in style.css that will help you to quickly get your design off the ground.
  • Full support for WooCommerce plugin integration with hooks in inc/woocommerce.php, styling override woocommerce.css with product gallery features (zoom, swipe, lightbox) enabled.
  • Licensed under GPLv2 or later. :) Use it to make something cool.

Installation

Requirements

_s requires the following dependencies:

Quick Start

Clone or download this repository, change its name to something else (like, say, megatherium-is-awesome), and then you'll need to do a six-step find and replace on the name in all the templates.

  1. Search for '_s' (inside single quotations) to capture the text domain and replace with: 'megatherium-is-awesome'.
  2. Search for _s_ to capture all the functions names and replace with: megatherium_is_awesome_.
  3. Search for Text Domain: _s in style.css and replace with: Text Domain: megatherium-is-awesome.
  4. Search for  _s (with a space before it) to capture DocBlocks and replace with:  Megatherium_is_Awesome.
  5. Search for _s- to capture prefixed handles and replace with: megatherium-is-awesome-.
  6. Search for _S_ (in uppercase) to capture constants and replace with: MEGATHERIUM_IS_AWESOME_.

Then, update the stylesheet header in style.css, the links in footer.php with your own information and rename _s.pot from languages folder to use the theme's slug. Next, update or delete this readme.

Setup

To start using all the tools that come with _s you need to install the necessary Node.js and Composer dependencies :

$ composer install
$ npm install

Available CLI commands

_s comes packed with CLI commands tailored for WordPress theme development :

  • composer lint:wpcs : checks all PHP files against PHP Coding Standards.
  • composer lint:php : checks all PHP files for syntax errors.
  • composer make-pot : generates a .pot file in the languages/ directory.
  • npm run compile:css : compiles SASS files to css.
  • npm run compile:rtl : generates an RTL stylesheet.
  • npm run watch : watches all SASS files and recompiles them to css when they change.
  • npm run lint:scss : checks all SASS files against CSS Coding Standards.
  • npm run lint:js : checks all JavaScript files against JavaScript Coding Standards.
  • npm run bundle : generates a .zip archive for distribution, excluding development and system files.

Now you're ready to go! The next step is easy to say, but harder to do: make an awesome WordPress theme. :)

Good luck!

_s's People

Contributors

aahan avatar alaczek avatar bappi avatar crunnells avatar davidakennedy avatar emiluzelac avatar fklein-lu avatar gatespace avatar grappler avatar hugobaeta avatar iamtakashi avatar ianstewart avatar ismail-elkorchi avatar jrfnl avatar karmatosed avatar kovshenin avatar lancewillett avatar laurelfulford avatar michiecat avatar mor10 avatar mrwweb avatar obenland avatar p0o avatar philiparthurmoore avatar samikeijonen avatar sarahmonster avatar sixhours avatar thomasguillot avatar tiagonoronha avatar truongwp 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  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

_s's Issues

Where is the comment response form template?

Hi,

Thanx for developing this I really liked, but I hava a problem, where is the comment form template?, I mean, the

response, I dive and dive but couldn't find it :P

Thanx.

register sidebar on function.php

i renamed
Search for:'s'
Replace with:'underscores'
Search for:s
Replace with:underscores

Search for: _s
Replace with: Underscores

then upload it
when i tried to use it : Fatal error: Call to undefined function registerunderscoresidebar() in /home/membagi/public_html/wp-content/themes/Underscores/functions.php on line 93

Theme Check

Ran this theme through Theme Check http://wordpress.org/extend/plugins/theme-check/

Found this error: WARNING: Found wrong tag, remove from your style.css header.

And these recommendations:

RECOMMENDED: No reference to the_post_thumbnail() was found in the theme. It is recommended that the theme implement this functionality instead of using custom fields for thumbnails.
RECOMMENDED: No reference to add_theme_support( 'custom-background', $args ) was found in the theme. If the theme uses background images or solid colors for the background, then it is recommended that the theme implement this functionality.
RECOMMENDED: No reference to add_editor_style() was found in the theme. It is recommended that the theme implement editor styling, so as to make the editor content match the resulting post output in the theme, for a better user experience.
RECOMMENDED: could not find the file readme.txt in the theme. Please see Theme_Documentation for more information.
RECOMMENDED: get_current_theme found in the file inc/theme-options/theme-options.php. Deprecated since version 3.4. Use wp_get_theme() instead.
Line 256:
RECOMMENDED: add_custom_image_header found in the file inc/custom-header.php. Deprecated since version 3.4. Use add_theme_support( 'custom-header', $args ) instead.
Line 56: add_custom_image_header( $args['wp-head-callback'], $args['admin-head-callb

Since _s is by Auttomatic and suppose to be the ideal coding standards for WordPress having 0 recommendations would is probably desired.

Underscores Gallery?

Would be nice to get one up, I realize it's just a starter theme, but I feel it can help people visualize an end product better (especially if they're only making their first steps in themeing). Thoughts?

style.css included into admin

As you can see here, _s style.css file was included in the admin area. I don't know if this is the default (didn't look at code), but it brings some pretty unexpected behavior.

Typo in readme.txt

Actually it's double word "can" in row 11
'Sample theme options in /inc/theme-options/ that can can be activated'

Inconsistent use of 'section' in some files

Files in question - index.php, archive.php, search.php and single.php (AFAIK)

What's the problem - index.php and single.php have this:

<div id="primary" class="content-area">

while archive.php and search.php have this:

<section id="primary" class="content-area">

As you can see, one's section and another is div. Is this a mistake? It doesn't seem intentional, or is it?

PS: I am sticking with section as it seems more appropriate (than div) in this case.

Thumbnails?

Have you guys considered adding post thumbnail support to the theme?

Didn't see that one in there & seems like a basic thing that every theme should have but maybe I'm wrong? I know I use it in every theme.

Forgive me, but I'm too much of a git n00b to submit a pull request or whatever...

Move <title> markup to functions.php

From how I understand the WPTRT guideline on modifying the document title content, it would be best practice to filter 'wp_title' in functions.php and just have

<title><?php wp_title( /* optional params */ ); ?></title>

in header.php.

This would be a huge benefit for all SEO Plugins out there since they could easily modify the title and don't have to worry about stuff being added.

What do you say? :)

small menu toggle not working with Jetpack activated

Not sure if this is the correct venue, but I've recently completed developing a theme using _s and ZURB's Foundation grid. I've discovered that the small menu toggle doesn't work on iPhones or Android phones when the Jetpack plugin is activated. However the toggle will work with Jetpack activated if testing by resizing the browser window. I'm not sure where the anomaly lies but I thought it worth mentioning. I've applied the theme to my personal blog at http://royby.com, and de-activated Jetpack :-)

Helpful fork script.

The process of forking _s for your own uses is way too painful in its current state.

Add a word-wrap to .comment-content

I always add

.comment-content {
    word-wrap: break-word;
}

to my _s themes, as a prevention against someone who adds a really long url in a comment and screws up the layout, since it would just overflow out the box and result in an ugly x-scrollbar

just a thought

Parse error on activating

Hi,

I downloaded a version of _s from http://underscores.me/, installed it and on activating got this error:

Parse error: syntax error, unexpected T_LNUMBER, expecting T_STRING or '(' in /home/content/35/9805835/html/wp-content/themes/5cc/functions.php on line 27

I now cannot access my site from either front or back end. Any help?

Find and replace method kills local Wordpress

I'm obviously doing something wrong here (first attempts using Underscore) as whenever I clone the repo and do a find and replace as detailed in the readme, it kills my local Wordpress

Here are the steps I'm taking. Tried this with Coda 2 and Sublime Text 2...

I clone the repo into my themes folder:

git clone git://github.com/Automattic/_s.git

Theme works fine.

I rename the '_s' folder to 'underscores-theme'

I then do a search and replace, within the wp-content/themes/underscores-theme folder (should the scope of the find and replace be more limited??):

'_s' to be replaced with 'underscores-theme' (then save all the files)
_s_ to be replaced with underscore-theme_ (then save all the files)
_s to be replaced with Underscore-theme I have made sure there is a space before too (then save all the files)

When I then activate the theme I get this error in Chrome: The website encountered an error while retrieving http://localhost:8888/wp-admin/themes.php?activated=true

I have also tried using the find and replace commands on the command line e.g.

find . -type f -print0 | xargs -0 perl -pi -e "s/\'_s\'/\'underscores-theme\'/g;"
find . -type f -print0 | xargs -0 perl -pi -e "s/_s_/underscores-theme_/g;"
find . -type f -print0 | xargs -0 perl -pi -e "s/_s\b/Underscores-theme/g;"

However, the theme works fine when using the underscores.me tool and naming the theme there (which would indicate the find and replace I'm doing being wrong). Could anyone point out the error of my ways??

Underscores License to GPL v3

I want to ask about underscores license. Is it possible to license underscores to GPL v3? I find difficulties to combine this starter theme to any component that has APL v2. Thanks.

#nav-above conflicts with skip-to-content link in the primary menu

#136 suggests the use a bit of javascript for an a11y enhancement. While testing the code, I Noticed that the "skip to content" link does not technically skip to the content. The goal of this link is to allow users to bypass the top navigation menu. When this link is clicked, visual focus is given to #content. But the first thing we find inside #content is another nav element.

The easiest solution is removal, but I know that a lot of themes currently use post-level navigation above the loop.

Another solution would be to reword the markup moving the posts-nav outside of #content.

What do you think?

Excerpts not showing on Image.php

Hey Folks,

For images that are created in the "image" post format, the excerpt is not showing on the image page (image.php file). I thought there may be a plugin conflict. However, I installed a fresh copy of WordPress 3.5 and grabbed the most updated copy of underscores... no dice.

Help would be appreciated. Thx!

Customizer Support

I think it's time to introduce some simple Customizer code into the theme. Would love to hear other developers feedback, about how simple or not this code should be and I'll wrap up the code. I'm thinking about something similar, that Otto uses in his tutorials.

Maybe add support for custom background with back-compat.

I thought (at first) that it was strange that _s does not provide support for custom backgrounds and then I realized that it is rather easy to do and the settings will be different for every theme.

After completing another project, I noticed that there is quite a bit of code that needs to be written to use the new hotness as well as provide backwards compatibility. Here's what it looks like:

/**
 * Setup the WordPress core custom background feature.
 *
 * Use add_theme_support to register support for WordPress 3.4+
 * as well as provide backward compatibility for previous versions.
 * Use feature detection of wp_get_theme() which was introduced
 * in WordPress 3.4.
 *
 * Hooks into the after_setup_theme action.
 */
function _s_register_custom_background() {
    $args = array(
        'default-color' => 'f7f7f7',
        'default-image' => get_template_directory_uri() . '/images/background.png',
    );

    $args = apply_filters( '_s_custom_background_args', $args );

    if ( function_exists( 'wp_get_theme' ) ) {
        add_theme_support( 'custom-background', $args );
    } else {
        define( 'BACKGROUND_COLOR', $args['default-color'] );
        define( 'BACKGROUND_IMAGE', $args['default-image'] );
        add_custom_background();
    }
}
add_action( 'after_setup_theme', '_s_register_custom_background' );

Proper Copyright/License Attribution in style.css

Since Underscores will undoubtedly be used as the base for many derivative works, it is especially important to include the GNU-recommended copyright/license attribution to style.css:

Whichever license you plan to use, the process involves adding two elements to each source file of your program: a copyright notice (such as “Copyright 1999 Terry Jones”), and a statement of copying permission, saying that the program is distributed under the terms of the GNU General Public License (or the Lesser GPL).

The copyright notice should include the year in which you finished preparing the release (so if you finished it in 1998 but didn't post it until 1999, use 1998). You should add the proper year for each release; for example, “Copyright 1998, 1999 Terry Jones” if some versions were finished in 1998 and some were finished in 1999. If several people helped write the code, use all their names.

For software with several releases over multiple years, it's okay to use a range (“2008-2010”) instead of listing individual years (“2008, 2009, 2010”) if and only if every year in the range, inclusive, really is a “copyrightable” year that would be listed individually; and you make an explicit statement in your documentation about this usage.

So, where this statement is in style.css:

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.

...I would recommend adding something like:

_s ("Underscores") WordPress Theme, Copyright 2012 Automattic, Inc.
This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.

This would be especially helpful for the Theme Review Team, as it would facilitate enforcement of proper copyright/license attribution for derivative works. (We're already starting to see _s-derivative Themes submitted.)

Move $content_width declaration inside _s_setup()

On one of the articles in theThemeShaper WordPress Theme Tutorial: 2nd Edition Series, which uses code based on _s, it's been suggested in the comments that $content_width should be moved inside _s_setup().

Here is the reason given in the comments (by Justin Tadlock):

"This makes sure that it’s easy for child themes to know exactly what point to overwrite it. It also allows you to get rid of the isset() check."

(I'm aware that _s is not intended to be a parent theme, though.)

Chip Bennett commented:

"We (the Theme Review Team) have been trying to move developers more toward putting everything in functions.php inside callbacks. Is there any advantage/disadvantage in doing so with $content_width?"

Opinions?

Make no-results post a partial

In the light of DRY, wouldn't it make sense to have the no-results post be its own partial and call it with get_template_part() ?
It is used in achives.php and search.php and if people start creating category.php, tag.php or author.php templates, it would also be used there.

BUG? _s theme menu not displayed at all in Opera Mini

Hi,

I tested the unchanged _s theme and I love it. But on my cell with Opera Mini and then online in Opera's Opera Mini Simulator [ http://www.opera.com/developer/tools/mini/ ] the top (main) menu is not displayed at all.

Then I deactivate the CSS by renaming the style.css and the menu finally shows up. I also checked the thematic and toolbox themes w/ the simulator and my cell. Both showed the menu. Any help is very well appreciated.

No home.php or front-page.php?

Since index.php is always used as the ultimate fallback template, I try to avoid using specific code on it (eg. stuff that would be exclusive to the home page, maybe a slider). Using front-page.php in a theme might not work as it would require user input in the blog's settings, but what about using home.php?

I'd love to know why you guys decided to go without it!

Small-Menu.js and .matchMedia

Have you given any consideration to using .matchMedia instead of window.width() for the js breakpoints? Would this be helpful for those using CSS media queries for other style changes? or perhaps there isn't yet wide enough browser support? I've devised my own solution, but I wanted to inquire if this was even something the main project would be interested in incorporating.

More specific selector for images contained in captions.

We currently use the following code to ensure that images within captions stretch to fill their containers.

.wp-caption img {
    display: block;
    margin: 1.2% auto 0;
    max-width: 98%;
}

I think that the scope of the selector is a bit too wide because it can easily target images contained within the caption paragraph were are meant to be displayed inline. This generally happens with smilies. The following code will ignore smilies.

.wp-caption img[class*="wp-image-"] {
    display: block;
    margin: 1.2% auto 0;
    max-width: 98%;
}

What do you think?

WordPress SEO and _S, error when search string not found

While testing a theme built with _S I got a strange error (see below) whenever the search string was not found and the WordPress SEO plugin was activated, the problem occurs even with the base _s install, any ideas on why this would happen or what could cause it???

NOTE: Debug bar is turned on...

( ! ) Notice: Trying to get property of non-object in F:\wamp\www\wordpress\wp-includes\post-template.php on line 30
Call Stack
#   Time    Memory  Function    Location
1   0.0004  682800  {main}( )   ..\index.php:0
2   0.0006  687632  require( 'F:\wamp\www\wordpress\wp-blog-header.php' )   ..\index.php:17
3   1.0417  35879464    require_once( 'F:\wamp\www\wordpress\wp-includes\template-loader.php' ) ..\wp-blog-header.php:16
4   1.0425  35901496    include( 'F:\wamp\www\wordpress\wp-content\themes\_s\search.php' )  ..\template-loader.php:43
5   1.0426  35901496    get_header( )   ..\search.php:9
6   1.0427  35906200    locate_template( )  ..\general-template.php:34
7   1.0429  35906368    load_template( )    ..\template.php:366
8   1.0434  35953544    require_once( 'F:\wamp\www\wordpress\wp-content\themes\_s\header.php' ) ..\template.php:390
9   1.0484  35967984    wp_head( )  ..\header.php:42
10  1.0484  35968064    do_action( )    ..\general-template.php:1576
11  1.0497  35978416    call_user_func_array ( )    ..\plugin.php:403
12  1.0497  35978448    WPSEO_Frontend->head( ) ..\plugin.php:403
13  1.0556  35981264    do_action( )    ..\class-frontend.php:455
14  1.0557  35982976    call_user_func_array ( )    ..\plugin.php:403
15  1.0557  35983008    WPSEO_OpenGraph->opengraph( )   ..\plugin.php:403
16  1.0558  35983008    WPSEO_OpenGraph->og_title( )    ..\class-opengraph.php:36
17  1.0558  35983088    WPSEO_Frontend->title( )    ..\class-opengraph.php:77
18  1.0560  35983456    WPSEO_Frontend->get_title_from_options( )   ..\class-frontend.php:306
19  1.0567  35993624    wpseo_replace_vars( )   ..\class-frontend.php:185
20  1.0571  36000928    wpseo_get_value( )  ..\wpseo-functions.php:163
21  1.0571  36000928    get_post_custom( )  ..\wpseo-functions.php:21
22  1.0571  36000976    get_the_ID( )

— thanks.

Including a theme options demo

Just thinking, since we have an example theme-options page, would it be an idea to also include some kind of demo file on how to actually use the (current) theme options?

(perhaps we could even output it after the content using the default WordPress sample page)

I know from experience -being a somewhat novice programmer/designer myself- this is where most people get actually stuck :)

width:auto for full-size images not working properly on Chrome

With regards to this PoC commit - mpeshev@27c2064

The author has mentioned that the width: auto has been set for the sake of IE8. However, it's not working properly on WebKit (Chrome specifically) since images with attributes width/height are expanded to the content width. Could be tested with the Theme Unit Test data, Images Test, page 3 (or just an image with width/height attributes).

Disclosure: not tested on IE here. running on Linux.

Widget titles should be <h2>, not <h1>?

It doesn't seem right to have h1 elements for every widget in the sidebar. I've always agreed with the position that there should generally only be one h1 per page.

Thoughts?

documentation issue

"Search for: _s & replace with: Megatherium"

doing this will break functions.php as many functions include this string in their names

example: after_setup_theme

Optional Sass Support

Is there any interest in using Sass instead of CSS?

It would require project contributors to compile and submit Sass for the repo. However, theme developers could choose whichever they prefer; Sass or CSS.

Here's the Sass branch I've been working on:
https://github.com/jeremychurch/_s/tree/convert-to-sass

I've got a couple things to cleanup, but I can make a pull request if there's any interest.

Trying to remove RSS

Hi,
I'm trying to remove RSS from the theme and it doesn't work.
I have tried
adding this to the functions file

I then tried
function disable_rss() {
return null;
}
add_filter('default_feed', 'disable_rss');

finally I added to the the wp-config.php file
remove_theme_support('automatic-feed-links');

None of this worked. I'd like to know how to edit the header contents and add or remove scripts or links, everything I try doesnt work.
Thanks

CSS Links

Alrighty, this isn't so much an issue, but a request for assistance with this awesome _s theme! I'm totally rockin' it, but I'm having a difficult time figuring out the best way to use custom style sheets based on media. I see the enqueue for styles in functions.php, but I'm not familiar with how to navigate all that. I know I can just put my html in the header, but I don't think that is the appropriate way to handle it.

I've checked out the codex and the forums, but I can't seem to find an answer to this particular situation.

In regular markup, here is my goal:

<link rel="stylesheet" type="text/css" href="style.css" media="screen, handheld" />
<link rel="stylesheet" type="text/css" href="enhanced.css" media="screen  and (min-width: 40.5em)" />
<!--[if (lt IE 9)&(!IEMobile)]>
<link rel="stylesheet" type="text/css" href="enhanced.css" />
<![endif]-->

If I can figure this out, I'm off to the races! Thank you SO much for any assistance.

Joe Snell

Rework _s_content_nav() to only print markup if links will be printed.

_s prints navigation markup even if no links are generated. What do you think about adjusting the logic in _s_content_nav() so that it only prints html if a link is present? I think that this would be a great modification for two reasons:

  1. Some themes may style the nav element and would display as an empty box if there are one page or less worth of posts.
  2. Users of screen readers will not hear the "Post navigation" heading read to the screen where there are no links at all.

"wp_enqueue_style/script was called incorrectly" on a fresh install

In wordpress debug mode I get this Notice:

wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.

wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or init hooks.

This also happen if I run debug mode on a clean install of _s Theme.

Why? How can I fix this?

Thank you

Add .alignnone to list of captioned images that get bottom margin.

If the last element in the post content is a captioned image that has a class of alignnone and something is appended to the_content like sharing links in Jetpack. There will be no whitespace between them: https://f.cloud.github.com/assets/468369/7546/e2959e8c-441b-11e2-8938-0c2c573d651c.png

The following should fix this:

.wp-caption.aligncenter,
.wp-caption.alignleft,
.wp-caption.alignright,
.wp-caption.alignnone {
    margin-bottom: 1.5em;
}

What do you think?

Nothing entered in search results in display of 'home', fix presented

When someone enters nothing into the search field, the user is redirected to the 'home' page.

See issue here along with fix:

http://wordpress.org/support/topic/blank-search-sends-you-to-the-homepage

Code to add to the functions file to fix issue:

/**
 * When user enters nothing in search, my_request_filter returns list of posts
 * 
 * @link http://wordpress.org/support/topic/blank-search-sends-you-to-the-homepage
 * @param string $query_vars
 * @return string
 */
function my_request_filter( $query_vars ) {
    if( isset( $_GET['s'] ) && empty( $_GET['s'] ) ) {
        $query_vars['s'] = " ";
    }
    return $query_vars;
}
add_filter( 'request', 'my_request_filter' );

The above code will still allow the search to perform its normal duties. It only fixes things when the search form is empty.

Thoughts on this technique?

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.