• 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

Infinity Pro: Adding custom page with widgets ?

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 › Archived Forums › Design Tips and Tricks › Infinity Pro: Adding custom page with widgets ?

This topic is: not resolved

Tagged: custom page, Infinity Pro, widgets

  • This topic has 10 replies, 2 voices, and was last updated 5 years, 11 months ago by Boblebad.
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • February 23, 2017 at 2:38 pm #201852
    Boblebad
    Participant

    Hi

    Regarding adding a custom page and widgets, do i just add the code for the widgets in the price-page.php(my custom page), functions.php, output.php and customize.php or do i make new files of the last two ?

    And regarding the last two output.php and customize.php, if i get it right, then i'll have to make new variables to take care of the images for the Price Page ?

    I of course need to alter the CSS where i would like it to be different than the one used on the Front Page.

    Is there anything else i need to do besides registering the widgets in
    Price Page:

    function soulmeeting_price_page_widgets() {
    
    	echo '<h2 class="screen-reader-text">' . __( 'Main Content', 'infinity-pro' ) . '</h2>';
    
    	genesis_widget_area( 'price-page-1', array(
    		'before' => '<div id="price-page-1" class="price-page-1"><div class="image-section widget-area fadeup-effect"><div class="wrap">',
    		'after'  => '</div></div></div>',
    	) );
    
    }

    functions.php:

    // Register Price Page widget areas.
    genesis_register_sidebar( array(
    	'id'          => 'price-page-1',
    	'name'        => __( 'Price Page 1', 'infinity-pro' ),
    	'description' => __( 'This is the price page 1 section.', 'infinity-pro' ),
    ) );

    And also, if i'm getting this right, i can just reuse the code from the other widgets, i just need to change their names accordingly ?

    All the best
    Carsten

    February 26, 2017 at 9:55 am #201998
    Victor Font
    Moderator

    Register the new widget areas in functions.php. Add the code to display them in your new template. Yes, you can reuse code and rename functions accordingly so there's no conflict.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 26, 2017 at 10:05 am #201999
    Boblebad
    Participant

    Thank you for your answer Victor 🙂

    I tried it and have it working, but am stuck on getting the background images showing. Everything seams right, but they are not showing up ?

    February 26, 2017 at 11:38 am #202002
    Victor Font
    Moderator

    Output.php only displays the background images on the front page. If you want the background images on another page, you have to change the following conditional to include the new page:

    if ( is_front_page() ) {
    			$css .= ( ! empty( $section ) && ! empty( $background ) ) ? sprintf( '.front-page-%s { %s }', $section, $background ) : '';
    		}

    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 26, 2017 at 12:29 pm #202019
    Boblebad
    Participant

    Thank you again Victor 🙂

    By that, do you mean that i can add another line in the file or do i have to create another file for my custom page ?

    February 26, 2017 at 12:39 pm #202020
    Boblebad
    Participant

    I found out that i tried editing that file before, but i forgot an instance in it. But it gives me an "Call to undefined function is_price_page()"

    I tried changing it to price-page, but that didn't help. I also have changed ".price-page-%s".

    February 26, 2017 at 2:27 pm #202025
    Victor Font
    Moderator

    Unless you created a function called is_price_page(), there's not such thing. You need to use a WordPress conditional: https://codex.wordpress.org/Conditional_Tags.

    Try is_page() with the page number parameter.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 27, 2017 at 1:42 am #202056
    Boblebad
    Participant

    Is "front page" a standard out of the box WordPress function ?

    Be course i can only find something like it in front-page.php: "function infinity_front_page_genesis_meta()"

    February 27, 2017 at 5:11 am #202066
    Victor Font
    Moderator

    Let me refer you again to the codex. It answers your question about WordPress out of the box conditionals. https://codex.wordpress.org/Conditional_Tags.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    February 27, 2017 at 12:48 pm #202108
    Boblebad
    Participant

    Well, in some way it works, but it doesn't.

    I just changed the code from front to price page. The interesting part is that i have only assigned an image to the first widget. That does not show. But in widget two and three, where there's no image assigned, images shows up.

    How does that happen ?

    February 27, 2017 at 1:30 pm #202109
    Boblebad
    Participant

    Is it possible to split this between the two pages ?:

    $images = apply_filters( 'infinity_images', array( '1', '2', '3', '4', '5', '6', '7', '8', '9', '10' ) );

    Or is it not the problem. The images are just taken from 1 and up, that's the two images used on the price page.

    If i understand the theme correctly, then there can only be one output.php and also only one customize.php.

  • Author
    Posts
Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

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