• 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

Reposition page title with class

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

Community Forums › Forums › General Genesis Framework Discussions › Reposition page title with class

This topic is: not resolved

Tagged: entry-title, genesis_do_post_title, genesis_entry_header, genesis_widget_area

  • This topic has 3 replies, 2 voices, and was last updated 11 months, 3 weeks ago by Brad Dalton.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • April 5, 2022 at 12:52 am #504955
    roiemiz100
    Participant

    Hi,
    I am trying to reposition single page titles and register widget under it.
    thats what I did so far:

    /*reposition title*/
    add_action( 'get_header', 'repo_title' );
    function repo_title () {
    if ( is_page() && !is_front_page()) {
    remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    add_action( 'genesis_after_header', 'genesis_do_post_title' );
    }
    }

    /*add widget*/
    genesis_register_sidebar( array(
    'id' => 'custom-widget',
    'name' => __( 'Custom Widget', 'genesis' ),
    'description' => __( 'Custom Widget Area', 'sample-theme' ),
    ) );
    add_action( 'genesis_after_header', 'add_genesis_widget_area', 15 );
    function add_genesis_widget_area() {
    if ( is_page() && !is_front_page())
    genesis_widget_area( 'custom-widget', array(
    'before' => '<div class="custom-widget widget-area">',
    'after' => '</div>',
    ) );
    }
    }
    Any idea how can I wrap those two elements in same class?
    THX

    April 5, 2022 at 1:16 am #504956
    Brad Dalton
    Participant

    This might work

    genesis_register_sidebar( array(
        'id' => 'custom-widget',
        'name' => __( 'Custom Widget', 'genesis' ),
        'description' => __( 'Custom Widget Area', 'sample-theme' ),
    ) );
    
    
    add_action( 'genesis_entry_header', 'repo_title' );
    function repo_title () {
    
    if ( is_singular('page') ) {
    
        remove_action( 'genesis_entry_header', 'genesis_do_post_title' );
    
        add_action( 'genesis_after_header', 'genesis_do_post_title' );
    
        genesis_widget_area( 'custom-widget', array(
            'before' => '<div class="custom-widget widget-area">',
            'after' => '</div>',
        ) );
    
        }
    
    }
    

    Tutorials for StudioPress Themes.

    April 5, 2022 at 2:43 am #504958
    roiemiz100
    Participant

    Thank you very much Brad.

    It start looking good but now those two elements got into container and not full width as I want it to be.
    before the change:
    before
    after the change:
    after

    April 5, 2022 at 2:56 am #504959
    Brad Dalton
    Participant

    You

    Any idea how can I wrap those two elements in same class?

    You never mentioned full width.

    You can modify the code so it displays full width using a full width hook.


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Log In

CTA

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

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 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