Community Forums › Forums › Archived Forums › Design Tips and Tricks › Position Logo & Navbar
Tagged: Wordpress
- This topic has 18 replies, 4 voices, and was last updated 9 years, 8 months ago by Tony @ AlphaBlossom.
-
AuthorPosts
-
July 15, 2014 at 11:36 am #114408sookieMember
Hi Guys,
I am trying to get the logo and navbar to look like this website: http://pinchofyum.com
I want my header to look like that too. I have managed to move the logo to the left but having trouble with the navbar.
Another question is, how do I move Previous and Next Post hyperlinks to the top of each post - currently they are at the bottom of the post?
Here is the website am working on:
Thanks
http://www.recipetineats.com/July 15, 2014 at 12:16 pm #114413Genesis DeveloperMemberLogin to dashboard and Goto Widgets Page ( Appearance-> Widgets) . There have "Header Right" sidebar. Drag & Drop the Custom Menu widget in to Header Right sidebar and choose the correct menu from drop down and save it. Then your menu will display at right side of the logo.
http://wpsites.net/web-design/next-previous-post-links-genesis/
July 15, 2014 at 12:23 pm #114415sookieMemberHi Genwrock, thanks for your help. There is no Header Right with this theme.
July 15, 2014 at 1:37 pm #114420Tony @ AlphaBlossomMemberHi,
You can try adding this to your theme's functions.php file to move the nav into the header:
// Reposition the primary navigation menu remove_action( 'genesis_after_header', 'genesis_do_nav' ); add_action( 'genesis_header', 'genesis_do_nav' );
Then you'll have to adjust the css - set a width on .site-title, and make necessary adjustments to the nav. If you get stuck with css let us know.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 15, 2014 at 2:35 pm #114428sookieMemberThanks Tony,
I added the code to the functions.php and used this in CSS:
.site-title,
.site-title a {
font-family: 'Open Sans', sans-serif;
font-size: 50px;
font-size: 5rem;
font-weight: 300;
letter-spacing: 4px;
letter-spacing: .4rem;
line-height: 1.625;
text-align: center;
text-transform: uppercase;
}Still no change. I have live traffic coming to the website at the moment.
July 15, 2014 at 2:43 pm #114431Tony @ AlphaBlossomMemberI'm not sure what theme your using...also, that code is for the primary nav. If your theme is using the secondary nav or custom, you'll have to adjust for that.
I've used the code many times (and currently using on my site) and it works with most genesis themes, but if the theme is using custom menus and locations it won't work as is.
Your nav is not being moved into the header so I'm wondering if it's something other than primary.
Which theme is it? If it's 3rd party, I recommend contacting them as well.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 15, 2014 at 2:47 pm #114434Tony @ AlphaBlossomMemberSorry for not looking closely. The css says it's nav secondary.
Just replace genesis_do_nav with genesis_do_subnav on both lines and it should take care of the issue. Sorry for not looking at that first.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 15, 2014 at 3:05 pm #114438bandjMemberI think it would be easier to go with the standard Genesis header which has the widget in it. Is there anything in the function about a custom header or header callback?
July 15, 2014 at 3:15 pm #114441Tony @ AlphaBlossomMemberIt certainly would be easier, but OP said there's no header right widget area...in which case registering the widget, adding the widget to the header and styling would not be easier.
I don't want to confuse the OP with a bunch of options, so I'll take myself out of the conversation to keep things simple.
Have a great one!
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 15, 2014 at 4:09 pm #114450sookieMemberThanks guys for all your help. Am using the foodie theme and when I replaced the do_nav with the subnav, I got this:
Parse error: syntax error, unexpected 'genesis_header' (T_STRING) in /home3/lulu2929/public_html/booking/wp-content/themes/foodie/functions.php on line 367
Here is a website using the same theme and they have managed to do it: http://www.healthyrecipeecstasy.com
July 15, 2014 at 4:24 pm #114454Tony @ AlphaBlossomMemberIt's possible that the ' marks didn't get copied over correctly...I know this works, doing it on my own custom theme (just tried this code again on my site with no issues. Maybe copy from StudioPress directly and just change the "genesis_before_header" to "genesis_header" (click "view raw" and copy and paste): http://my.studiopress.com/snippets/navigation-menus/#reposition-secondary
Otherwise not sure...possible that the theme is coded different, but it's the way to move nav as recommended by StudioPress and I've done it many times with no issues.
It's a 3rd party theme so I don't have access to the code...but the site you linked to does have a header right widget area, which as bandj said would be easier if it exists.
If it still doesn't work, and you're sure there's no header right widget area, probably best to contact the Foodie theme dev.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 15, 2014 at 4:44 pm #114457sookieMemberHi Tony, I have used this code and works now:
//* Reposition the primary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );It's just the CSS, am trying to figure out now. I have moved to a demo site now because the other one was on a live website with traffic: http://booking.mozyou.com
Thanks
July 15, 2014 at 5:03 pm #114459Tony @ AlphaBlossomMembergenesis_header actually places the nav inside the header wrap, which makes it easier to style...not sure why it's an issue since it's a standard genesis hook.
Maybe try getting rid of the "_before" again to see, but if not you can still make it work by adjusting your css:
.site-header { background: url("http://booking.mozyou.com/wp-content/uploads/2014/07/cropped-Blog-Header1.jpg") no-repeat scroll 0 0 rgba(0, 0, 0, 0) !important; float: left; width: 250px; } .nav-primary { float: right; margin-top: 90px; width: 500px; }
You can adjust as needed, and you'll have to add your border to .site-inner (but your header is a little wider than your site-inner).
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 15, 2014 at 5:20 pm #114463sookieMemberThanks Tony,
I have added the CSS code but the border isn't the same as the: http://pinchofyum.com and the menu is too far from the logo.
July 15, 2014 at 5:24 pm #114464sookieMemberTony, what's your email? I need a bit more help with this. If you have time.
July 15, 2014 at 5:26 pm #114465Tony @ AlphaBlossomMemberSure, you can email me at [email protected].
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
July 16, 2014 at 7:52 am #114455sookieMemberHi Tony,
Here is what my function.php looks like:
<?php
/**
* Custom amendments for the theme.
*
* @category Foodie
* @subpackage Genesis
* @copyright Copyright (c) 2013, Shay Bocks
* @license GPL-2.0+
* @link http://www.shaybocks.com/foodie/
* @since 1.0.9
*
*/add_action( 'genesis_setup', 'foodie_theme_setup', 15 );
/**
* Theme Setup
*
* This setup function attaches all of the site-wide functions
* to the correct hooks and filters. All the functions themselves
* are defined below this setup function.
*
* @since 1.0.1
*/
function foodie_theme_setup() {//* Child theme (do not remove)
define( 'CHILD_THEME_NAME', __( 'Foodie Theme', 'foodie' ) );
define( 'CHILD_THEME_VERSION', '1.0.9' );
define( 'CHILD_THEME_URL', 'http://www.shaybocks.com/foodie/' );
define( 'CHILD_THEME_DEVELOPER', __( 'Shay Bocks', 'foodie' ) );//* Add viewport meta tag for mobile browsers.
add_theme_support( 'genesis-responsive-viewport' );//* Add HTML5 markup structure.
add_theme_support( 'html5' );//* Set content width.
$content_width = apply_filters( 'content_width', 610, 610, 980 );//* Add new featured image sizes.
add_image_size( 'horizontal-thumbnail', 680, 453, TRUE );
add_image_size( 'square-thumbnail', 450, 450, TRUE );//* Add support for custom background.
add_theme_support( 'custom-background' );//* Unregister header right sidebar.
unregister_sidebar( 'header-right' );//* Create color style options.
add_theme_support( 'genesis-style-selector', array(
'theme-citrus' => __( 'Citrus', 'foodie' ),
'theme-earthy' => __( 'Earthy', 'foodie' ),
)
);//* Add support for custom header.
add_theme_support( 'genesis-custom-header', array(
'width' => 400,
'height' => 170
)
);//* Add support for 3-column footer widgets.
add_theme_support( 'genesis-footer-widgets', 3 );//* Enqueue child theme styles.
add_action( 'wp_enqueue_scripts', 'foodie_enqueue_syles' );//* Enqueue child theme JavaScript.
add_action( 'wp_enqueue_scripts', 'foodie_enqueue_js' );//* Add child theme body class.
add_filter( 'body_class', 'foodie_add_body_class' );//* Add post navigation.
add_action( 'genesis_after_entry_content', 'genesis_prev_next_post_nav', 5 );//* Modify the WordPress read more link.
add_filter( 'the_content_more_link', 'foodie_read_more_link' );//* Add excerpt read more link.
add_filter( 'excerpt_more', 'get_read_more_link' );
add_filter( 'the_content_more_link', 'get_read_more_link' );//* Modify the speak your mind text.
add_filter( 'genesis_comment_form_args', 'foodie_comment_form_args' );//* Customize the credits.
add_filter( 'genesis_footer_creds_text', 'foodie_footer_creds_text' );//* Load an ad section before .site-inner.
add_action( 'genesis_before', 'foodie_top_ad' );//* Load theme sidebars.
foodie_register_sidebars();//* Disable the editor for the recipe page template.
add_action( 'admin_init', 'foodie_remove_widgeted_editor' );}
/**
* Load Genesis
*
* This is technically not needed.
* However, to make functions.php snippets work, it is necessary.
*/
require_once( get_template_directory() . '/lib/init.php' );/**
* Load all additional stylesheets for the Foodie theme.
*
* @since 1.0.0
*/
function foodie_enqueue_syles() {
wp_enqueue_style( 'foodie-google-fonts', '//fonts.googleapis.com/css?family=Pontano+Sans|Open+Sans:300,400', array(), CHILD_THEME_VERSION );
}/**
* Load all required JavaScript for the Foodie theme.
*
* @since 1.0.1
*/
function foodie_enqueue_js() {
$js_uri = get_stylesheet_directory_uri() . '/lib/js/';
// Add general purpose scripts.
wp_enqueue_script( 'foodie-general', $js_uri . 'general.js', array( 'jquery' ), '1.0.0', true );
}/**
* Add the theme name class to the body element.
*
* @param string $classes
* @return string Modified body classes.
*
* @since 1.0.0
*/
function foodie_add_body_class( $classes ) {
$classes[] = 'foodie';
return $classes;
}/**
* Modify the Genesis read more link.
*
* @param string $more
* @return string Modified read more text.
*
* @since 1.0.0
*/
function foodie_read_more_link() {
return '<p></p>' . __( 'Read More', 'foodie' ) . ' »';
}/**
* Add excerpt read more link.
*
* @param string $more
* @return string Modified read more text.
*
* @since 1.0.0
*/
function get_read_more_link() {
return '... <p></p>' . __( 'Read More', 'foodie' ) . ' »';
}/**
* Modify the speak your mind text.
*
* @since 1.0.0
*/
function foodie_comment_form_args( $args ) {
$args['title_reply'] = __( 'Comments', 'foodie' );
return $args;
}/**
* Customize the footer text
*
* @param string $creds Default credits.
* @return string Modified Shay Bocks credits.
*
* @since 1.0.0
*/
function foodie_footer_creds_text( $creds ) {
return sprintf(
'[footer_copyright before="%s "] · [footer_childtheme_link before=""] %s %s · %s [footer_genesis_link url="http://www.studiopress.com/" before=""] · [footer_wordpress_link before=" %s"]',
__( 'Copyright', 'foodie' ),
__( 'by', 'foodie' ),
CHILD_THEME_DEVELOPER,
__( 'Built on the ', 'foodie' ),
__( 'Powered by ', 'foodie' )
);
}/**
* Load an ad section before .site-inner.
*
* @since 1.0.7
*/
add_action( 'genesis_before', 'foodie_top_ad' );
function foodie_top_ad() {
//* Return early if we have no ad.
if ( ! is_active_sidebar( 'top-ad' ) ) {
return;
}echo '<div class="top-ad">';
dynamic_sidebar( 'top-ad' );
echo '</div>';
}/**
* Register sidebars for Foodie theme.
*
* @since 1.0.0
*/
function foodie_register_sidebars() {
genesis_register_sidebar( array(
'id' => 'top-ad',
'name' => __( 'Top Ad', 'foodie' ),
'description' => __( 'This is the top ad section.', 'foodie' ),
) );
genesis_register_sidebar( array(
'id' => 'home-top',
'name' => __( 'Home Top', 'foodie' ),
'description' => __( 'This is the home top section.', 'foodie' ),
) );
genesis_register_sidebar( array(
'id' => 'home-middle',
'name' => __( 'Home Middle', 'foodie' ),
'description' => __( 'This is the home middle section.', 'foodie' ),
) );
genesis_register_sidebar( array(
'id' => 'home-bottom',
'name' => __( 'Home Bottom', 'foodie' ),
'description' => __( 'This is the home bottom section.', 'foodie' ),
) );
genesis_register_sidebar( array(
'id' => 'recipes-top',
'name' => __( 'Recipes Top', 'foodie' ),
'description' => __( 'This is the recipes top section.', 'foodie' ),
) );
genesis_register_sidebar( array(
'id' => 'recipes-bottom',
'name' => __( 'Recipes Bottom', 'foodie' ),
'description' => __( 'This is the recipes bottom section.', 'foodie' ),
) );
}/**
* Perform a check to see whether or not a widgeted page template is being used.
*
* @since 1.0.0
* @return bool
*/
function foodie_using_widgeted_template( $templates = '' ) {
// Return false if we have post data.
if ( ! isset( $_REQUEST['post'] ) ) {
return false;
}// If no widgeted templates are passed in, check only the default recipes.php.
if ( empty( $templates ) ) {
$templates = array( 'recipes.php' );
}foreach ( $templates as $template ) {
// Return true for all widgeted templates
if ( get_page_template_slug( $_REQUEST['post'] ) === $template ) {
return true;
}
}// Return false for other templates.
return false;
}/**
* Check to make sure a widgeted page template is is selected and then disable
* the default WordPress editor.
*
* @since 1.0.0
*/
function foodie_remove_widgeted_editor() {
// Return early if a widgeted template isn't selected.
if ( ! foodie_using_widgeted_template() ) {
return;
}// Disable the standard WordPress editor.
remove_post_type_support( 'page', 'editor' );//* Add an admin notice for the recipe page template.
add_action( 'admin_notices', 'foodie_widgeted_admin_notice' );
}/**
* Check to make sure a widgeted page template is is selected and then show a
* notice about the editor being disabled.
*
* @since 1.0.0
*/
function foodie_widgeted_admin_notice() {
// Display a notice to users about the widgeted template.
echo '<div class="updated"><p>';
printf (
__( 'The normal editor is disabled because you\'re using a widgeted page template. You need to use widgets to edit this page.', 'foodie' ),
'widgets.php'
);
echo '</p></div>';
}July 16, 2014 at 8:20 am #114528Genesis DeveloperMemberI checked the code. Header Right sidebar is removed by this code
//* Unregister header right sidebar. unregister_sidebar( ‘header-right’ );
If you want then you can enable it this way
//* Unregister header right sidebar. // unregister_sidebar( ‘header-right’ );
July 16, 2014 at 2:06 pm #114566Tony @ AlphaBlossomMemberAgreed, that would be the easiest way...restoring your header right widget so you can add your nav.
Tony Eppright | http://www.AlphaBlossom.com | Follow me on twitter @_alphablossom
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.