Home › Forums › Omega Child › codes to show primary Nav menu below header, don't work
- This topic has 1 reply, 2 voices, and was last updated 11 years, 5 months ago by
han.
-
AuthorPosts
-
November 19, 2014 at 12:26 am #2746
hmsalverda
ParticipantI use Omega/Family theme as the base for my new website.
I created my own child to make it possible to make safe changes in PHP and CSS without changing the files and settings belonging to Omega/Family themes.One of the things I need to change is that the the navigation menu has to appear below the header and not above it, because in my opinion that’s not logical at all for branding.
The website I am building is: http://hiddenselfies.com/
I did extended research on internet and on this forum how to change the position of the nav menu.
I thought I found the answers and did everything those answers told me to do. However nothing works!!!
The navigation still shows up above the header instead of below.
I emptied my cache already several times: No difference.
So, I have a huge problem and I have not much time anymore to solve this.This is what I did till now following the instructions I found at Omega:
In my self- created child theme I changed the header.php into this:
‘<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset=”<?php bloginfo( ‘charset’ ); ?>”>
<title><?php wp_title( ‘ |’, true, ‘right’ ); ?></title>
<link rel=”profile” href=”http://gmpg.org/xfn/11″>
<?php wp_head(); ?>
</head><body <?php body_class(); ?> <?php omega_attr( ‘body’ ); ?>>
<?php do_action( ‘omega_after’ ); ?>
<div class=”<?php echo omega_apply_atomic( ‘site_container_class’, ‘site-container’ );?>”>
<?php
remove_action( ‘omega_before_header’ );
do_action( ‘omega_header’ );
do_action( ‘omega_after_header’ );
?><div class=”site-inner”>
<?php do_action( ‘omega_before_main’ ); ?>’
As Han recommended, I changed hooks.php in “Lib” folder on line 14/15 from “before_header” into “after_header”. So now this is the code:
‘/* Load the primary menu. */
add_action( ‘omega_after_header’, ‘omega_get_primary_menu’ );’Following the found instructions, in my self- created child theme I changed the function.php into this:
‘add_action( ‘after_setup_theme’, ‘child_theme_setup’, 11 );
function child_theme_setup() {
$prefix = hybrid_get_prefix();
remove_action( “{$prefix}_before_header”, ‘omega_get_primary_menu’ );
add_action( “{$prefix}_after_header”, ‘omega_get_primary_menu’ );
}’I controlled the Family theme functions php.
There is this code (concerning navigation):
‘function family_setup() {remove_action( ‘omega_before_header’, ‘omega_get_primary_menu’ );
add_action( ‘omega_after_header’, ‘omega_get_primary_menu’ );/* Add support for a custom header image. */
add_theme_support(
‘custom-header’,
array( ‘header-text’ => false,
‘flex-width’ => true,
‘uploads’ => true,
‘default-image’ => get_stylesheet_directory_uri() . ‘/images/header.jpg’ ,
‘admin-head-callback’ => ‘family_admin_header_style’,
‘admin-preview-callback’ => ‘family_admin_header_image’
));’So what more or less can there be done still, to make that navigation work as it needs to work? If anybody knows the answer, please let me know!! I would be very grateful.
November 24, 2014 at 2:35 am #2761han
KeymasterYou only need to change 1 line of code in functions.php
replace
add_action( 'omega_after_header', 'family_banner' );
with
add_action( 'omega_header', 'family_banner' ); -
AuthorPosts
You must login to reply to this topic.
