• Resolved sublimeandcolour

    (@sublimeandcolour)


    Hi, wondering if I can get the instagram gallery widget on the Orvis homepage? Would like it to sit under the intro text on the LHS of the portfolio. I have installed it but appears on the blog pages.

    Can Jetpack support other plug-ins? Trying [instagram-feed] but doesn’t let me click the button to add a new one from the admin menu. If anyone could help that would be great thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @sublimeandcolour!

    To display a widget, we’ll need to create a new sidebar to hold the widget.

    First – set up a child theme.

    We’ll start by creating a new sidebar by adding the following to the functions.php of the child theme:

    register_sidebar( array(
        'name'          => esc_html__( 'Left Sidebar', 'orvis' ),
        'id'            => 'sidebar-2',
        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h2 class="widget-title">',
        'after_title'   => '</h2>',
    ) );
    

    That tells WordPress that there should be a second sidebar. Next we’ll tell it how to build that sidebar.

    In your child theme folder, create a new file named sidebar-left-sidebar.php.

    Paste the following into that file:

    <?php
    if ( ! is_active_sidebar( 'sidebar-2' ) ) {
    	return;
    }
    ?>
    
    <div id="tertiary" class="widget-area" role="complementary">
    	<?php dynamic_sidebar( 'sidebar-2' ); ?>
    </div><!-- #tertiary -->

    Now WordPress knows how to structure the sidebar. The last step will be telling WordPress when to use it all.

    If you’d like your Portfolio Page (any page you assign the Portfolio Template to) to display this sidebar, you’ll need to look in the parent theme again. This time, copy the page-templates folder into your child theme. Open that folder and edit your new copy of portfolio-page.php.

    We’re going to add a line of code to this file so the sidebar gets displayed. Near the bottom, just before

    <?php get_sidebar( 'sidebar' ); ?>
    add this line:

    <?php get_sidebar( 'left-sidebar' ); ?>

    Now any widgets you add to Left Sidebar will be displayed on your Portfolio page.

    We’ll also need a bit of CSS to fix the alignment:

    #tertiary.widget-area {
        float: left;
    }

    Add that to the child theme’s style.css.

    Give that a try and let me know how it goes ??

    • This reply was modified 8 years ago by Kathryn Presner. Reason: fix code formatting
    • This reply was modified 8 years ago by Kathryn Presner. Reason: fixed code formatting
    Thread Starter sublimeandcolour

    (@sublimeandcolour)

    Thanks Chad, sorry I’m a bit of a rookie at all this. I don’t have the ‘Add’ button in my Themes menu to create a Child Theme. Also not sure where my WordPress folder directory is on my computer (as I’ve done it on my work computer! (Mac) ?? Cheers

    https://sublimeandcolour.wordpress.com/wp-admin/themes.php

    Ah – you have a WordPress.com site. That changes things a bit!

    There are two different forums, this one, for sites hosted outside of WordPress.com, and then a dedicated forum for WordPress.com users:
    https://en.forum.wordpress.com

    The forums here are for a different kind of WordPress site, called self hosting.

    This is the single best article I’ve ever seen on the differences: https://dailypost.wordpress.com/2013/11/14/com-or-org/

    Setting up a child theme isn’t something that will be possible on your current setup, but if you’d like to create a child theme to add a sidebar you could move to a self hosted site instead.

    Regarding the folder location – the data for your site (like theme files) lives on your server, not on your local computer. In your case it’s all taken care of by the WordPress.com servers.

    Thread Starter sublimeandcolour

    (@sublimeandcolour)

    Ah ha, thanks for your help Chad. The article helps a lot ??

    You’re welcome! ??

    When you’re ready, you can use the “Resolved” link in the sidebar to close this thread!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Instagram gallery widget on Orvis homepage’ is closed to new replies.