WordPress.org

Support

Support » Themes and Templates » Customizr » Adding sections to front page.

Adding sections to front page.

  • Hi,

    I would like to add 3 more sections below features pages on the front page. Something similar to what pro.com.

    Is there a way to customize front page in this way?

    Thank you.

Viewing 15 replies - 1 through 15 (of 19 total)
  • Similar to which site? The link to the example that you give above doesn’t work.

    Similar to http://pro.com

    Thank you.

    You can add anything you like if you create a page (called “home”) for example and set your home page to be a static page pointing to that page in Appearance > Customize.

    Theme Author nikeo

    @nikeo

    Hi @oerdem19, I found your request interesting and decided to make a snippet for this.
    http://www.themesandco.com/snippet/adding-sections-to-any-page-or-posts-in-customizr/

    Hope this will be what you needed!

    wow , thank you so much nikeo…

    I can’t get it to work 🙁 (i’ve pasted the PHP code and added 1 page id to the array) but I am sure I will figure it out

    thank you so much

    Well that’s tomorrow’s play session organized 🙂 Thanks nikeo!

    Thanks a lot Nikeo, Great support I must say.

    I will give it a try and let you know about results.

    Hi Nikeo,

    I have pasted code to childs functions.php file.

    It looked like this. Just added a single id to array.

    But it didnt work. I still get the original page.

    Thanks.

    <?php
    function add_custom_sections ( $args ) {
    //set up global vars with the section parameters
    global $section_params;
    $defaults = array(
    ‘ids’ => array(21) ,

    oerdem,

    1. When you post code, please use backticks, otherwise the forum code will try to interpret your code. (Use the code button if your keyboard doesn’t have a backtick.)

    2. The $args parameter in the add_custom_sections() function needs to be defined. See Nicolas’s example, where he defines them as follows:

    $my_sections_args = array(
        'ids'             => array( 1 , 45 , 47 ),
        'blur'             => 0,
        'background'     => array( 1 => "randcolors", 45 => 'thumb' , 47 => 'randimages' ),//'randcolors'
        'context'        => 'home',
        'hook'             => '__before_main_wrapper',
        'apply_shadow'     => false,
        'layout'         => 'boxed',
    );
    add_custom_sections ( $my_sections_args );

    Hello,

    This is absolutely awesome!

    Theme Author nikeo

    @nikeo

    Well, if you have pasted the whole snippet code into your functions.php and used the @electricfeet example of implementation, it should work fine.

    It works now, thank you! 🙂

    Theme Author nikeo

    @nikeo

    Great 🙂 Would you mind sharing an url of the result?
    Thanks

    That looks very impressing, my only question is, how do you get the “This is a title” and the clickeable button?

    I’d share it gladly, but I’m building the site locally on my computer and it’s not yet ready. But I’ve uploaded a screenshot here.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Adding sections to front page.’ is closed to new replies.
Skip to toolbar