Daily theme and global posts in home

Hi, how can I remove the default homepage? I'd like to show just the last global posts of every blog, instead of some posts of the default one. I see that there is a widget to do so, but how can i add them in the home (not as widget)?

  • Tammie
    • WordPress Wizard

    @huemac: You can remove the home.php page from the theme files and it should just use the default layout for a blog. If however you do not mean removing the homepage but the current homepage content then you'd have to edit home.php. Which is it you are intending if you can clarify and if it is the later as in change the home page layout you'd want to remove potentially the current custom content and add your own in. As to how it all depends on what you want removed - is it all or is it just a section?

  • Huemac
    • Site Builder, Child of Zeus

    Hi Tammie, i'd like to remove the main content of the home page.. but keep the sidebar. So i think that the file is home.php. But the question is, how can i show the list of the last N posts from all the blogs (i run a mu version), as it's done by the "recent side wide posts" widget?
    Thanks

  • Tammie
    • WordPress Wizard

    @Huemac: I haven't tried it but think https://premium.wpmudev.org/project/recent-global-posts-widget 'should' work.

    You want to remove line 4 -35:

    <?php
    $featuretype = get_option('dev_buddydaily_featuretype');

    if($featuretype == "video"){
    locate_template( array( '/library/components/featured-video.php' ), true );
    }
    elseif($featuretype == "tabbed"){
    locate_template( array( '/library/components/featured-tabbed.php' ), true );
    }
    elseif($featuretype == "slideshow"){
    locate_template( array( '/library/components/featured-slideshow.php' ), true );
    }
    else{
    locate_template( array( '/library/components/featured-none.php' ), true );
    }
    ?>
    <?php
    $contenttype = get_option('dev_buddydaily_latesttype');
    if($contenttype == "rows"){
    locate_template( array( '/library/components/content-rows.php' ), true );
    }
    elseif($contenttype == "column"){
    locate_template( array( '/library/components/content-columns.php' ), true );
    }
    elseif($contenttype == "wall"){
    locate_template( array( '/library/components/content-thewall.php' ), true );
    }
    else{
    locate_template( array( '/library/components/content-none.php' ), true );
    }
    ?>

    Then you want to make a widget ready area for that bit and you should be set but may need to do some style changes. I also haven't tested this so unsure as to the results as just suggesting theory here.

  • Tammie
    • WordPress Wizard

    @Huemac:

    Where you add it is up to you but how you make a widget area in your theme is shown here:

    functions.php add:

    register_sidebars( 1,
    array(
    'name' => 'namecallingit-sidebar',
    'before_widget' => '<div id="%1$s" class="widget %2$s">',
    'after_widget' => '</div>',
    'before_title' => '<h4>',
    'after_title' => '</h4>'
    )
    );

    *Call it whatever you want -sidebar this just illustrates

    in home.php or where want sidebar:

    <?php if ( !function_exists('dynamic_sidebar')
    || !dynamic_sidebar('namecallingit-sidebar') ) : ?>
    <div class="widget-error">
    <?php _e( 'Please log in and add widgets to this column.', 'buddypress' ) ?> /wp-admin/widgets.php?s=&show=&sidebar=namecallingit-sidebar"><?php _e( 'Add Widgets', 'buddypress' ) ?>
    </div>
    <?php endif; ?>

    *again note namecallingit is just there for demo.

    That should give you enough information to get a widget area.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.