• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

horace1

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • August 14, 2017 at 8:41 pm in reply to: How to remove site footer wrap from bootstrap genesis theme #210373
    horace1
    Member

    Thanks, I've added it to the function file but it still not working. What is it I'm doing wrong?

    June 28, 2017 at 4:43 pm in reply to: How to get logo to show in Bootstrap Navbar #208417
    horace1
    Member

    Im using the sample theme and this is just a test site which i have, hence why i am only using two nav items. All i want is to be able to display the logo in the top left like how you would see on a bootstrap nav so that i can use it in future projects.

    I have inserted the following code below in to my functions.php which has helped display the actual menu but for some reason cant display the standard Genesis theme logo or dynamic text.

    /** Integrating Bootstrap NAVs
    *
    * Tab and Pill navs require role='presentation' as an attribute to the

  • of a menu item
    * Currently, there is no filter to add an attribute to the
  • (only added id or class)
    * One way to do this would be to override the start_el function but seems like a lot of code to
    * copy to only add an attribute. Created a simple jQuery solution in script.js.
    *
    * fixed-top and fixed-bottom require padding-top and padding-bottom, respectively. This is also
    * added via jQuery in script.js since we can get the computed height of the nav and add the appropriate
    * padding.
    */
    //Menu variables:
    //An admin interface could be created to change these values on the dashboard
    $bfg_genesis_menu = false;
    $bfg_menu_type = 'navbar'; //Possible values: tab, pill, navbar
    $bfg_navbar_type = 'static-top'; //Possible values: static-top, fixed-top, fixed-bottom
    $bfg_navbar_align = 'right';

    //

    if (!$bfg_genesis_menu) {

    //Take over nav
    remove_action( 'genesis_after_header', 'genesis_do_nav' );
    remove_action( 'genesis_after_header', 'genesis_do_subnav' );
    //TODO test adding subnav

    //Needed for all Bootstrap menus
    add_filter('nav_menu_link_attributes', 'bfg_link_attributes',10,2);
    add_filter('nav_menu_css_class', 'bfg_add_dropdown_active',10);
    if ( $bfg_navbar_type === 'fixed-bottom' ) {
    add_filter( 'body_class', 'bfg_fixed_bottom_body_class' );
    }
    if ( $bfg_navbar_type === 'fixed-top' ) {
    add_filter( 'body_class', 'bfg_fixed_top_body_class' );
    }

    //TODO add a admin user interface for these options.
    //************Uncomment a single section to alter location of Primary Nav - Primary 1 thru 5

    //Primary 1***********Uncomment the following for Bootstrap primary nav replacing header*****************
    //Genesis | Theme Settings | Header settings determines if nav_brand is shown or site_title is shown
    // "Image Logo" will show nav_brand and site_title will be there but hidden
    /* remove_action( 'genesis_header', 'genesis_do_header' ); //remove genesis header
    add_action( 'genesis_header', 'bfg_custom_primary_do_nav', 5 );
    add_filter('genesis_structural_wrap-header', 'bfg_no_wrap'); //remove structural wrap
    add_filter('bfg_navbar_brand_content', 'bfg_navbar_brand_header'); //add brand*/

    //Primary 2*********Uncomment the following for Bootstrap primary nav after Genesis Header****************
    add_action( 'genesis_after_header', 'bfg_custom_primary_do_nav', 5 );

    //Primary 3*********Uncomment the following for Bootstrap primary nav before footer**********************
    /* add_action( 'genesis_before_footer', 'bfg_custom_primary_do_nav'); */

    //Primary 4*********Uncomment the following for Bootstrap primary nav as footer**********************
    /* remove_action('genesis_footer','genesis_do_footer');
    add_action( 'genesis_footer', 'bfg_custom_primary_do_nav');
    add_filter('genesis_structural_wrap-footer', 'bfg_no_wrap'); //remove structural wrap
    add_filter('bfg_navbar_brand_content', 'bfg_navbar_brand'); //add brand*/

    //Primary 5*********Uncomment the following for Bootstrap primary nav after Genesis Footer****************
    /* add_action( 'genesis_after_footer', 'bfg_custom_primary_do_nav' );*/

    // Uncomment out if you want a search bar in the navbar
    // add_filter('bfg_navbar_content', 'bfg_navbar_search_form');
    }

    function bfg_fixed_bottom_body_class( $classes) {
    $classes[] = 'fixed-bottom';
    return $classes;
    }
    function bfg_fixed_top_body_class( $classes) {
    $classes[] = 'fixed-top';
    return $classes;
    }

    /** Create primary nav using bootstrap. */
    function bfg_custom_primary_do_nav() {
    global $bfg_menu_type, $bfg_navbar_type, $bfg_navbar_align;

    //If menu has not been assigned to Primary Navigation, abort.
    if ( ! has_nav_menu( 'primary' ) ) {
    return;
    }
    //Default values
    $container_class = '';
    $menu_class = 'nav nav-pills';
    $items_wrap = ' <div class="container-fluid"><ul id="%1$s" class="%2$s">%3$s</div>';
    switch ( $bfg_menu_type ) {
    case 'pill':
    $menu_class = 'nav nav-pills';
    $items_wrap = ' <div class="container-fluid"><ul id="%1$s" class="%2$s">%3$s</div>';
    break;
    case 'tab':
    $menu_class = 'nav nav-tabs';
    $items_wrap = ' <div class="container-fluid"><ul id="%1$s" class="%2$s">%3$s</div>';
    break;
    case 'navbar':
    $container_class = 'navbar navbar-default navbar-' . sanitize_text_field( $bfg_navbar_type );
    $menu_class = 'nav navbar-nav navbar-' . sanitize_text_field( $bfg_navbar_align );
    $navbar_content = '';
    $items_wrap = '<div class="container-fluid"><div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> ';
    $items_wrap .= apply_filters( 'bfg_navbar_brand_content', $navbar_content ) . '</div> <div class="collapse navbar-collapse" id="navbar-collapse-1">';
    $items_wrap .= apply_filters( 'bfg_navbar_content', $navbar_content ) . '<ul id="%1$s" class="%2$s">%3$s</div></div>';
    break;
    }

    wp_nav_menu( array(
    'container' => 'nav',
    'container_class' => $container_class,
    'menu_class' => $menu_class,
    'items_wrap' => $items_wrap,
    'walker' => new bfg_Walker_Nav_Menu(),
    'theme_location' => 'primary'
    ) );

    }

    /** Extends the Walker_Nav_menu and overrides the start_lvl function to add class to sub-menu */
    class bfg_Walker_Nav_Menu extends Walker_Nav_Menu {
    function start_lvl(&$output, $depth) {
    $indent = str_repeat("\t", $depth);
    $output .= "\n$indent<ul class=\"sub-menu dropdown-menu\">\n";
    }
    }

    /** adds attributes to anchor, , of a dropdown menu */
    function bfg_link_attributes($atts,$item) {
    if(in_array('menu-item-has-children',$item->classes)) {
    $atts["class"] = "dropdown-toggle";
    $atts["data-toggle"] = "dropdown";
    }
    return $atts;
    }
    /** adds the necessary classes bootstrap expects for menu items,

  • , with children and current-menu-* items */

    function bfg_add_dropdown_active($classes) {

    if(in_array('menu-item-has-children',$classes) ){
    $classes[] = 'dropdown';
    }
    if(in_array('current-menu-item',$classes) ){
    $classes[] = 'active';
    }
    if(in_array('current-menu-parent',$classes) ){
    $classes[] = 'active';
    }
    return $classes;
    }
    //TODO search submit button is slightly off of navbar-brand
    //TODO need media query to change line-height when responsive menu is active
    function bfg_navbar_search_form($navbar_content) {
    $url = get_home_url();

    $navbar_content .= '<form method="get" class="navbar-form navbar-left" action="' . $url . '" role="search">';
    $navbar_content .= '<div class="form-group">';
    $navbar_content .= '<input class="form-control" name="s" placeholder="Search" type="text">';
    $navbar_content .= '</div>';
    $navbar_content .= '<button class="btn btn-default" value="Search" type="submit">Submit</button>';
    $navbar_content .= '</form>';

    return $navbar_content;
    }

    function bfg_navbar_brand($navbar_content) {
    //TODO admin interface to add image, brand, url to options
    $image = get_stylesheet_directory_uri() . 'images/logo.png';
    list($width, $height, $type, $attr) = getimagesize($image);

    $url = get_home_url();
    $brand = get_bloginfo('name');
    $navbar_content .= '
    ';
    $navbar_content .= ' ' . $brand . '
    ';

    if ($height > 50) {
    $navbar_content .= '<style> .navbar-nav li a, .navbar-form { line-height: ' . $height . 'px;}';
    $navbar_content .= '.navbar-brand {height: inherit;}</style>';
    }

    return $navbar_content;
    }
    function bfg_navbar_brand_header($navbar_content) {
    //TODO admin interface to add image, brand, url to options

    ob_start();
    do_action('genesis_site_title');
    $site_title = ob_get_contents();
    ob_end_clean();
    ob_start();
    do_action('genesis_site_description');
    $site_description = ob_get_contents();
    ob_end_clean();

    $image = get_stylesheet_directory_uri() . 'images/logo.png';
    list($width, $height, $type, $attr) = getimagesize($image);

    $url = get_home_url();
    $brand = get_bloginfo('name');
    $navbar_content .= '<div class="title-area">';

    $navbar_content .= ' ' . $brand . ' ';
    $navbar_content .= $site_title . $site_description . "</div>";
    if ($height > 50) {
    $navbar_content .= '<style> .header-image .navbar-nav li a, .header-image .navbar-form { line-height: ' . $height . 'px;}';
    $navbar_content .= '.navbar-brand {display: none;} .header-image .navbar-brand {display: block; height: inherit;}';
    $navbar_content .= '.</style>';
    }

    return $navbar_content;
    }

    function bfg_no_wrap($arg) {
    return '';
    }

May 9, 2017 at 12:06 pm in reply to: How to intergrate bootstrap into Genesis sample theme #206198
horace1
Member

Thanks it work

March 13, 2017 at 8:50 am in reply to: SVG For older browser's #202999
horace1
Member

Thanks,

I found a fallback from Bill Erickson

SVG Logo with PNG Fallback

but I just ended up putting it like this

background: url(images/logo.png) no-repeat;
background-image: url(images/logo.svg), none;

March 13, 2017 at 7:14 am in reply to: SVG For older browser's #202992
horace1
Member

Thanks so much, is there one which you could use from a background image as it was more for the logo i was trying to make a svg and then make a png in in the fallback.

February 24, 2017 at 4:38 pm in reply to: Hide Scripts ( Page-specific Scripts ) and Page attribute #201926
horace1
Member

Thanks, I added this for post

remove_meta_box( 'genesis_inpost_scripts_box' , 'post' , 'normal' );

February 24, 2017 at 2:06 pm in reply to: Hide Scripts ( Page-specific Scripts ) and Page attribute #201918
horace1
Member

I found the code:

Remove the Page attribute meta data
=====================

function remove_page_fields() {
remove_meta_box( 'pageparentdiv' , 'page' , 'normal' ); //removes page attributes
}
add_action( 'admin_menu' , 'remove_page_fields' );

Remove Scripts
=====================

remove_action( 'admin_menu', 'genesis_add_inpost_scripts_box' );

February 23, 2017 at 1:42 pm in reply to: Hide Scripts ( Page-specific Scripts ) and Page attribute #201844
horace1
Member

I'm wanting to remove or hide it from clients.

February 23, 2017 at 1:41 pm in reply to: Hide Scripts ( Page-specific Scripts ) and Page attribute #201843
horace1
Member

No,I mean when like a client is logged into wordpress and they go to edit a page they see scripts at the bottom and page attribute to the right.

October 18, 2016 at 2:09 pm in reply to: Header issue #194989
horace1
Member

No thats just one image, basically I want when you click on the logo its takes you the home page and when you click on the free consultation it takes you to the contact page. But i want i want it positioned like how it is in the image.

July 21, 2016 at 12:36 pm in reply to: Sticky header covering half my images #189950
horace1
Member

Sorry think ive figured it out

July 9, 2016 at 8:46 am in reply to: how to display custom post type in blog format #189177
horace1
Member

Ok thanks but how can i make it show a excerpt instead of the whole story and display thumbnails?

July 6, 2016 at 10:05 am in reply to: What is the best way to have a sticky navigation with the logo to the side #188960
horace1
Member

ok thanks alot for that

  • Author
    Posts
  • Viewing 13 posts - 1 through 13 (of 13 total)

    CTA

    Ready to get started? Create a site or shop for themes.

    Create a site with WP EngineShop for Themes

    Footer

    StudioPress

    © 2025 WPEngine, Inc.

    Products
    • Create a Site with WP Engine
    • Shop for Themes
    • Theme Features
    • Get Started
    • Showcase
    Company
    • Brand Assets
    • Terms of Service
    • Accptable Usse Policy
    • Privacy Policy
    • Refund Policy
    • Contact Us
    Community
    • Find Developers
    • Forums
    • Facebook Group
    • #GenesisWP
    • Showcase
    Resources
    • StudioPress Blog
    • Help & Documentation
    • FAQs
    • Code Snippets
    • Affiliates
    Connect
    • StudioPress Live
    • StudioPress FM
    • Facebook
    • Twitter
    • Dribbble