Posts by ThemeChills

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

  $args = array(
                    'posts_per_page' => 10,
                    'post_status'     => 'publish',
                    'post_type'      => 'page',
                    'post_parent'  => 0,
                    'meta_query'      => array(
                        array(
                            'key'     => '_wp_page_template',
                            'value'   => 'homepage.php',
                            'compare' => '!=',
                        ),
                    ),
                );
                $the_tiles_query = new WP_Query( $args ); 

Yep, had worked it out. Thanks mate!

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

Hi all,

I have what hopefully is a quick one…here is the scenario.

I’ve created a custom loop using WP_Query. It currently lists out all pages. Here is the code:


                $args = array(
                    'posts_per_page' => 10,
                    'post_status'     => 'publish',
                    'post_type'      => 'page',
                    'meta_query'      => array(
                        array(
                            'key'     => '_wp_page_template',
                            'value'   => 'homepage.php',
                            'compare' => '!=',
                        ),
                    ),
                );
                $the_tiles_query = new WP_Query( $args );    

I would like for any page that is selected as a Child page to NOT SHOW in this list.

What changes would you make to the above to achieve this result?

Thanks,

Leo

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

All good, sorted it out :)

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

And here is the code as stored in the functions.php file....


function textdomain_widgets_init() {

    register_sidebar( array(
        'name'             => __( 'Homepage Header', 'textdomain' ),
        'id'             => 'homepage-header',
        'description'   => __( 'Widgets will be shown on the homepage header area.', 'textdomain' ),
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'     => '</div>',
        'before_title'     => '<h2 class="widget-title">',
        'after_title'     => '</h2>',
    ) );

    register_sidebar( array(
        'name'             => __( 'Homepage Main Content', 'textdomain' ),
        'id'             => 'homepage-main-content',
        'description'   => __( 'Widgets will be shown on the homepage main content area.', 'textdomain' ),
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'     => '</div>',
        'before_title'     => '<h2 class="widget-title">',
        'after_title'     => '</h2>',
    ) );

    register_sidebar( array(
        'name'             => __( 'Countdown', 'textdomain' ),
        'id'             => 'countdown',
        'description'   => __( 'Widget area to display countdown timer on all pages.', 'textdomain' ),
        'before_widget' => '<div id="%1$s" class="widget %2$s">',
        'after_widget'     => '</div>',
        'before_title'     => '<h2 class="widget-title">',
        'after_title'     => '</h2>',
    ) );

    register_sidebar( array(
        'name'          => __( 'Sidebar', 'textdomain' ),
        'id'            => 'sidebar-1',
        'description'   => __( 'Widgets in this area will be shown in the sidebar.', 'textdomain' ),
        'before_widget' => '<aside id="%1$s" class="widget %2$s">',
        'after_widget'  => '</aside>',
        'before_title'  => '<h2 class="widget-title">',
        'after_title'   => '</h2>',
    ) );

}
add_action( 'widgets_init', 'textdomain_widgets_init' );

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

Hi all,

Here is the scenario, I have 3 custom widget areas which are working as expected in my parent theme.

Then I created a Child Theme and went to test these. Thing is, only 2 show in the Customizer and all four in the Widget admin screen, though one of those widget areas is not rendering the widget I include within it.

So stumped… have been Googling around for a similar issue with no sucess. Have you experienced this? Any ideas?

Thanks,

Leo

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

Yes ;)

Great, thanks @Pirenko!

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

No, widget ready areas don’t need to be declared in a plugin.

You just declare it directly in the theme, right?

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

Hi everyone,

Just a quick one, do you know if widget areas ( i.e. register_sidebar() ) need to be included as part of a plugin?

For example, if I am creating a widgetized homepage with it’s own sections? Or should this just go under the functions.php file?

I’m wondering as I know certain functionality needs to be part of a plugin and was wondering if this is applicable to these areas as well.

Also, if so, how does one register these if they are not in the functions.php file.

Thanks,

Leo

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

I feel was a small increase, at least for visiting products was for sure :)

Nice. Thanks for sharing.

162 posts
  • Has sold $10,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Located in Australia
+3 more
ThemeChills
says

That’s a great feeling. We been last 2 weeks. Good luck!

Did you receive a spike in sales?

by
by
by
by
by
by