Download the PHP package garyjones/genesis-header-nav without Composer

On this page you can find all versions of the php package garyjones/genesis-header-nav. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package genesis-header-nav

Genesis Header Nav

WordPress plugin that registers a menu location and displays it inside the header for a Genesis Framework child theme.

Description

The default method of getting a menu to appear in the top right of a site using a child theme of the Genesis Framework, is to add a create a menu in Appearance -> Menus, and then place a Custom Menu widget in the Header Right widget area. While this works, it produces markup as seen in screenshot 1, and which has the following problems:

This plugin registers a new menu location called Header and, if a menu is assigned to it, displays it after the Header Right area. If you don't have any widgets in the Header Right area, then Genesis ensures that none of that widget area markup is output, so you end up with code like screenshot 2. If you do want a widget in the Header Right area, that's fine - it can be positioned and styled as you want, without negatively affecting the navigation menu as well.

Screenshots


Screenshot 1: Markup using Custom Menu widget. Note the aside, section and div parents to nav.



Screenshot 2: Markup using this plugin. nav is a sibling element to the title area div.

Requirements

Installation

Upload

  1. Download the latest tagged archive (choose the "zip" option).
  2. Go to the Plugins -> Add New screen and click the Upload tab.
  3. Upload the zipped archive directly.
  4. Go to the Plugins screen and click Activate.

Manual

  1. Download the latest tagged archive (choose the "zip" option).
  2. Unzip the archive.
  3. Copy the folder to your /wp-content/plugins/ directory.
  4. Go to the Plugins screen and click Activate.

Check out the Codex for more information about installing plugins manually.

Git

Using git, browse to your /wp-content/plugins/ directory and clone this repository:

git clone [email protected]:GaryJones/genesis-header-nav.git

Then go to your Plugins screen and click Activate.

Updates

This plugin supports the GitHub Updater plugin, so if you install that, this plugin becomes automatically updateable direct from GitHub.

Change Log

See the CHANGELOG.md.

Usage

Once activated, head to Appearance -> Menus. Create a menu as usual, and assign it to the Header menu location.

Backwards-incompatible Changes

The hook that filters the menu was called genesis_do_header_nav but is now called genesis_header_nav due to using the genesis_header_nav() function in Genesis 2.1.

2.0.0: Custom language files previously loaded from (example) WP_LANG_DIR . '/genesis-header-nav/genesis-header-nav-en_GB.po' now need to be placed at WP_LANG_DIR . '/plugins/genesis-header-nav-en_GB.po', as per language packs.

2.0.0: This plugin uses PHP namespaces, so you'll need PHP 5.3+ powering your site.

Customising

CSS

The plugin should work with all Genesis child themes, though you may need to add styles to position the output in the traditional place of top right, e.g.:

.nav-header {
    float: right;
    text-align: right;
    width: 50%;
}

Adjust the width as needed to allow enough space for your title area and menu items.

Priority

The plugin includes a genesis_header_nav_priority filter, with a default value of 12. Use the following values to reposition the nav accordingly:

If you want to add it in between the title and widget area, you'll need to unhook and re-build genesis_do_header() function so that the output of the widget area is in a different function that can be hooked to a later priority.

As an example, to add the nav before the title + widget area markup in the source, you can use the following:

add_filter( 'genesis_header_nav_priority', 'prefix_genesis_header_nav_priority' );
/**
 * Change the order of the nav within the header (Genesis Header Nav plugin).
 *
 * @param int $priority Existing priority. Default is 12.
 *
 * @return int New priority.
 */
function prefix_genesis_header_nav_priority( $priority ) {
    return 8;
}

Top Menu (above <header>)

If you give the above priority filter a value of less than 5, then the output will be before the <header>, so that you can display what might be considered a Top menu. Of course, this might mean that the "Header" menu location label is confusing, but since that string is internationalised, it's possible to filter that and change it to make it easier for users to understand:

add_filter( 'gettext', 'prefix_genesis_header_nav_name', 10, 3 );
/**
 * Change the name of the Header menu location added by Genesis Header Nav plugin.
 * 
 * @param string $translated_text Translated text.
 * @param string $original_text   Original text.
 * @param string $domain          Text domain.
 */
function prefix_genesis_header_nav_name( $translated_text, $original_text, $domain ) {
    if ( 'genesis-header-nav' === $domain && 'Header' === $original_text ) {
        return 'Top';
    }
    return $translated_text;
}

Removing the Menu

If you want the menu to not display, perhaps on a landing page, then you can do the following:

add_action( 'init', 'prefix_genesis_header_nav_remove', 11 );
/**
 * Remove Genesis Header Nav menu.
 */
function prefix_genesis_header_nav_remove() {
    if ( function_exists( 'Gamajo\GenesisHeaderNav\get_plugin' ) ) {
        remove_action( 'genesis_header', array( Gamajo\GenesisHeaderNav\get_plugin(), 'show_menu' ), apply_filters( 'genesis_header_nav_priority', 12 ) );
    }
}

Credits

Built by Gary Jones
Copyright 2013 Gamajo Tech


All versions of genesis-header-nav with dependencies

PHP Build Version
Package Version
Requires composer/installers Version ^1.0
php Version >=5.3.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package garyjones/genesis-header-nav contains the following files

Loading the files please wait ...