• Resolved dequecolour

    (@dequecolour)


    i am so hopeful that this will not be incredibly difficult:

    i have two columns of posts showing on my site, and right now, i think they just display in order by date.

    what i would like to do is create two columns, one column that is recent posts on the left, and one column of “favorite posts” or “recommended posts” where i could choose which posts will display.

    is that super hard, or could i maybe do it by adding code to my child theme, and if so, what/where? thanks so much in advance if you can advise.

    i’m using twenty twelve. the site is being developed at internalcompass.us/castle

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter dequecolour

    (@dequecolour)

    to be clear, i am referring to the area where i have posts on the main page, under the photoslider.

    Thread Starter dequecolour

    (@dequecolour)

    one more q – sorry. i would also love to be able to add the date underneath the titles of the titles of the posts like these sites do:

    any ideas how i can add that in twenty twelve? could i add box frames around the posts and titles like these two sites have, or no?

    https://theblondeabroad.com/
    https://theblondeabroad.com/

    Thread Starter dequecolour

    (@dequecolour)

    any takers? i looked at this site: https://www.leeabbamonte.com/ (whose link i meant to share up above) and it looks like his second column is a widget. That puzzled me — but, is that how I do it? Or is there a way to create a loop directly in the code of the index file and will call forth whichever posts she chooses for the favorites column? I’d love to do it with code if I can.

    Thread Starter dequecolour

    (@dequecolour)

    i feel like this is the right start, except it still doesn’t address putting the posts in two columns. still, the code doesn’t even work. if anyone smarter than i am could help, i’d appreciate it.

    <?php
    /**
     * The main template file.
     *
     * This is the most generic template file in a WordPress theme
     * and one of the two required files for a theme (the other being style.css).
     * It is used to display a page when nothing more specific matches a query.
     * For example, it puts together the home page when no home.php file exists.
     *
     * Learn more: https://codex.www.ads-software.com/Template_Hierarchy
     *
     * @package WordPress
     * @subpackage Twenty_Twelve
     * @since Twenty Twelve 1.0
     */
    
    get_header(); ?>
    
    <?php ?>
    	<div id="primary" class="site-content">
    		<div id="content" role="main">
    
            <div style="margin-bottom: 20px;">
    
            </div>
    
    		  <?php $my_query = new WP_Query('category_name=FAVORITES&posts_per_page=7');
      while ($my_query->have_posts()) : $my_query->the_post();
      $do_not_duplicate[] = $post->ID ?>
        <!-- Do stuff... -->
      <?php endwhile; ?>
        <!-- Do other stuff... -->
    <?php if (have_posts()) : while (have_posts()) : the_post();
     if (in_array($post->ID, $do_not_duplicate)) continue;
     ?>
     <?php twentytwelve_content_nav( 'nav-below' ); ?>
    
    			<article id="post-0" class="post no-results not-found">
    
    			<?php if ( current_user_can( 'edit_posts' ) ) :
    				// Show a different message to a logged-in user who can add posts.
    			?>
    				<header class="entry-header">
    					<h1 class="entry-title"><?php _e( 'No posts to display', 'twentytwelve' ); ?></h1>
    				</header>
    
    				<div class="entry-content">
    					<p><?php printf( __( 'Ready to publish your first post? <a href="%s">Get started here</a>.', 'twentytwelve' ), admin_url( 'post-new.php' ) ); ?></p>
    				</div><!-- .entry-content -->
    
    			<?php else :
    				// Show the default message to everyone else.
    			?>
    				<header class="entry-header">
    					<h1 class="entry-title"><?php _e( 'Nothing Found', 'twentytwelve' ); ?></h1>			</header>
    
    				<div class="entry-content">
    					<p><?php _e( 'Apologies, but no results were found. Perhaps searching will help find a related post.', 'twentytwelve' ); ?></p>
    					<?php get_search_form(); ?>
    				</div><!-- .entry-content -->
    			<?php endif; // end current_user_can() check ?>
    
    			</article><!-- #post-0 -->
    
    		</div><!-- #content -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
    Thread Starter dequecolour

    (@dequecolour)

    while some of that code is helpful (i found it about a month ago. the blog author is very smart.) it does not help in this instance because once i get to the issue of needing two loops in order to separate the featured versus recent posts, it’s not enough information. i read all about loops on codex, and i almost understand how to create the two loops as you can see above, but i still can’t get the code from that to work — always get an error at the last line of code. once i do create the two loops, i’ll still need more than the powertools site has. i actually posted a q to that blog directly a few days ago. thanks — seems like we are at least looking in the same directions

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘organizing posts on homepage’ is closed to new replies.