Jump to content
Sign in to follow this  
cdhphoenix

Homepage Only Post Excerpts

Recommended Posts

cdhphoenix

Hi, I have two questions; 1. Can I set up the Homepage to have only the callout, feature slider and boxes ONLY show up on the homepage, i plan on using it as a blog and find this set up really annoying having to "unclick" all these features every time I make a post. Its also very inconvenient, when I try to view "previous" blog entires and on the second and third page of archives the homepage features, boxes and callouts show up as well. 2. Can you help with my css so I can edit the way the post looks in its "truncated/excerpt" form on the homepage/blog page, and the way it looks viewed in a single post. I would like the entry text aligned left in a (permalink)single post view, but centred in the "truncated" view. Thank you for all your help, I greatly appreciate it! Have a great night guys -Phoenix

Share this post


Link to post
Share on other sites
Kate

Hi Phoenix - 1) You can assign it to the "pages" template in the settings area, and then "hide" it with CSS on all pages but the "home" page. 2) Have you tried Firebug? It will allow you to find the elements you want to target.

Share this post


Link to post
Share on other sites
cdhphoenix

Hi Kate, Can you help me figure out what to type in my custom css to hide it from all the pages but the homepage? I see the css selector code for each item i want to hide, but not sure what to type in. And if i hide them on the other pages, will it affect me inserting boxes and carousels on other page templates within the site, say if i want to make a portfolio layout with the grid based boxes. best, carolyn

Share this post


Link to post
Share on other sites
cmunns

`.category #feature, .single #feature, .archive #feature {display:none;}` The above would hide it on "posts pages" that are category based or single post based or archive based.

Share this post


Link to post
Share on other sites
cdhphoenix

Hi Adam, That didnt help me at all, i tried inputting into my custom css. And its still there. Please goto my site to see what I'm referring too: www.criterioninedit.com. When i click on "previous entries" on the homepage, it still shows my features and callouts on page 2 of archives. I want a blog. But for the homepage to have a feature slider, 3 boxes and a callout for a quote. When i click on previous entries everything still shows up. I placed all these widgets in my header. Do you have any suggestions where i can place them, and have it only the homepage. Is there anyway to write a css that commands these widgets on certain page id's that i select. For example, is there a way to command to it show up on the homepage and other pages that I direct it too? I still would like these widgets to be on specific pages that i create, like a gallery, or portfolio. Thank you! Carolyn

Share this post


Link to post
Share on other sites
bryan-hadaway

Pretty much, you can do everything you need with some tools and a little learning. Every page has an ID and as well as other classes like `.home`, `.blog` etc. to define just that one page or a category of pages. Firebug is essential to customization: http://www.pagelines.com/docs/changing-colors-fonts You can handle where to show widgets with this plugin: http://wordpress.org/extend/plugins/widget-logic/ As seen above: `display:none` is the trick you'll most likely use a lot for these customizations. Thanks, Bryan

Share this post


Link to post
Share on other sites
cdhphoenix

Thanks Bryan, I have taken your great advice and found some great plugins in which to display recent posts on a page template of my choosing. I have decided to choose my "feature" page template as my homepage and would like to add coding that .php (its called page.alpha.php in my admin) I am having trouble figuring out how to put my command in the php. Do you mind guiding me in where and how I could put it in the command in that particulate .php? I have the child theme installed and still have trouble grasping the concept. -Carolyn

Share this post


Link to post
Share on other sites
cdhphoenix

Hey bryan, So i have changed the homepage to a child template i created following the instructions. So far the homepage is called "home" with a page id of 61. This is all i have in the .php file, I added the script: <?php /* Template Name: Home */ setup_pagelines_template(); ...to my page.61.php file. I installed a plugin that lets to fetch my recent posts, its telling me to place some coding in the php which is: <?php mdv_recent_posts(); ?> I understand it needs to be in a hook?? Dont know where to start there, so I went looking for some php code that could pull recent quotes without a plugin and found this: <?php wp_get_archives('type=postbypost&limit=10'); ?> Which i assume in "Hook" language means: add_action('wp_get_archives', 'title_li=&type=postbypost&limit=10'); So i tried entering it in my php, and nothing shows up in my content section....any help? Is there a php code you recommend implementing that works? Am i doing something wrong with the php file? Am i not closing a bracket, what is wrong? I followed the documentation to the letter. I just want the recent 5 posts to show up on the homepage, with a previous link that will go directly to by blog page. I followed your advice and set up a child page template, and got a plugin. Now i just somehow need to understand php/hook language......help! Best, Carolyn

Share this post


Link to post
Share on other sites
cmunns

hooks are a way to add content. A function like this: `<?php wp_get_archives('type=postbypost&limit=10'); ?>` would be the content you place INSIDE of the hook function. This is the sort of thing you would place in your functions.php file ` add_action('pagelines_after_theloop','function_name'); function function_name(){ wp_get_archives('type=postbypost&limit=10'); } ` the function name is the second parameter of the add_action and the first parameter is the hook location or where the function will be inserted. Then you have to define the function by writing `function` with the function name you decided on followed by ` (){ //what the functions does } ` To do it only on the home page you could say: ` add_action('pagelines_after_theloop','function_name'); function function_name(){ if (is_front_page()): wp_get_archives('type=postbypost&limit=10'); endif; } `

Share this post


Link to post
Share on other sites
cdhphoenix

Thanks for replying, I read over your instructions, Its still a little confusing but I think I just need practice using Hooks, I copied and pasted:

add_action('pagelines_after_theloop','recentposts');
	
	function recentposts(){
	if (is_front_page()):
	wp_get_archives('type=postbypost&limit=10');
	endif;
	}
into my child functions.php and the home page still loads nothing in the page content area where the posts should. Should i be putting something in the home.php to call on this function? What is the usage of
//
to begin all my hooks? I renamed the
function_name
to "
recentposts

". But all i did was insert it in my functions.php and nothing happened. I feel like there should be something in my page template of what the homepage is. Any suggestions?

Share this post


Link to post
Share on other sites
cmunns

If you don't have the main content area active on the home page then it won't show. Also you can try using `is_home()` instead of `is_front_page()`

Share this post


Link to post
Share on other sites
cdhphoenix

Ok so after some tinkering around, I got it to show up, however it it shows up in bullet form? Would you happen to know how to code the php in my base functions.php so it looks like the blog format with the excerpt, title, and thumbnail and meta bar? I would attempt to copy the loop php but I am scared to ruin everything. I am aware another user is also having this problem, so i feel his pain. I was reading up on this link: http://brightscape.net/blog/display-latest-wordpress-post-on-static-page/ On how to display latest word press posts on static pages, but once again, I am stumped about the complexities of the darn hooks. I just want the homepage to have 5 recent posts with a Previous Link at the bottom to goto the blog page, the posts should look like my other posts on the blog, not in bullet form. Any help would be greatly appreciate. I am beginning to lose faith in making any progress with building my website!

Share this post


Link to post
Share on other sites
bryan-hadaway

Let me get some developer insight for PHP customization. Thanks, Bryan

Share this post


Link to post
Share on other sites
cdhphoenix

hi, just checking in to see if anyone was able to help me create "recent posts" on my static page (home page). I have already created a page-id in base for which is my static homepage. I have looked into plugins, but nothing is customizable to look exactly like my blog posts. can any one help me with the coding to place my recent 5 posts from my blog onto my static page? here is my template.loop.php for reference:

	<?php
	/*
	
		THE LOOP (Posts, Single Post Content, and Page Content)
	
		This file contains the WordPress "loop" which controls the content in your pages & posts.
		You can control what shows up where using WordPress and PageLines PHP conditionals
	
		This theme copyright (C) 2008-2010 PageLines
	
	*/
	
		global $pagelines_layout;
		global $post;
		global $wp_query;
	
		$count = 1;  // Used to get the number of the post as we loop through them.
		$clipcount = 2; // The number of clips in a row
	
		$post_count = $wp_query->post_count;  // Used to prevent markup issues when there aren't an even # of posts.
		$paged = intval(get_query_var('paged')); // Control output if on a paginated page
	
		if(is_admin()) query_posts('showposts=1'); // For parsing in admin, no posts so set it to one.
	
		$thumb_space = get_option('thumbnail_size_w') + 33; // Space for thumb with padding
	    $thumb = new MultiPostThumbnails(array(
	    'label' => 'Secondary Image',
	    'id' => 'secondary-image',
	    'post_type' => 'page'
	    )
	);
	
	// Start of 'The Loop'
	if(have_posts()){
	while (have_posts()) : the_post();
	
	if(!pagelines_show_clip($count, $paged) || is_admin()):
	
	?><div <?php post_class('fpost') ?> id="post-<?php the_ID(); ?>">
			<?php pagelines_register_hook( 'pagelines_loop_post_start', 'theloop' ); //hook ?>
	
			<?php if(pagelines('pagetitles') && is_page()):?>
				<h1 class="pagetitle"><?php the_title(); ?></h1>
				<?php pagelines_register_hook( 'pagelines_loop_page_title_after', 'theloop' );?>
			<?php endif;?>
	
					<?php if(!is_page()):?>
							<div class="post-meta fix">
								<?php if(pagelines_show_thumb( get_the_ID() )): // Thumbnails ?>
					            		<div class="post-thumb" style="margin-right:-<?php echo $thumb_space;?>px">
											" rel="bookmark" title="<?php _e('Permanent Link To', 'pagelines');?> <?php the_title_attribute();?>">
												<?php the_post_thumbnail('thumbnail');?>
	<?php if (class_exists('MultiPostThumbnails')
	    && MultiPostThumbnails::has_post_thumbnail('post', 'secondary-image')) :
	        MultiPostThumbnails::the_post_thumbnail('post', 'secondary-image'); endif; ?>
											
							            </div>
								<?php endif; ?>
	
								<div class="post-header fix <?php if(!pagelines_show_thumb($post->ID)) echo 'post-nothumb';?>" style="<?php
	
									if(pagelines_show_thumb($post->ID)){
										echo 'margin-left:'.$thumb_space.'px';
									}
	
									?>" >
									<?php pagelines_register_hook( 'pagelines_loop_post_header_start', 'theloop' ); //hook ?>
									<div class="post-title-section fix">
	
										<div class="post-title fix">
											<div class="post-category"><?php the_category(' / '); ?></div>
											<?php
												pagelines_get_post_title();
												pagelines_get_post_metabar();
											?>
	
										</div>
	
									</div>
									<?php if(pagelines_show_excerpt( $post->ID )): // Post Excerpt ?>
	
											<div class="post-excerpt"><?php the_excerpt(); ?></div>
	
											
<?php if(pagelines_is_posts_page() && !pagelines_show_content( $post->ID )): // 'Continue Reading' link echo get_continue_reading_link($post->ID); endif; pagelines_register_hook( 'after_pagelines_excerpt', 'theloop' ); //hook ?> <?php endif; ?> </div> </div> <?php endif;?> <?php if(pagelines_show_content( get_the_ID() )): // Post and Page Content ?> <div class="entry_wrap fix"> <?php pagelines_register_hook( 'pagelines_loop_before_post_content', 'theloop' ); //hook ?> <div class="entry_content"> <?php the_content(__('<p>Continue reading »</p>','pagelines'));?> <div class="clear"></div> <?php // Content pagination if( is_single() || is_page() ) wp_link_pages(array('before'=> __('<p class="content-pagination"><span class="cp-desc">pages:</span>', 'pagelines'), 'after' => '</p>', 'pagelink' => '<span class="cp-num">%</span>')); // Edit Link $edit_type = (is_page()) ? __('Edit Page','pagelines') : __('Edit Post','pagelines'); edit_post_link( '['.$edit_type.']', '', ''); pagelines_register_hook( 'pagelines_loop_after_post_content', 'theloop' ); //hook ?> </div> <div class="tags"> <?php the_tags(__('Tagged with: ', 'pagelines'),' • ',''); ?> </div> </div> <?php endif;?> <?php pagelines_register_hook( 'pagelines_loop_post_end', 'theloop' ); //hook ?> </div> <?php endif; // End of Full-Width Post Area if(pagelines_show_clip($count, $paged) || is_admin()): // Start Clips if($clipcount % 2 == 0):?> <div class="clip_box fix"> <?php pagelines_register_hook( 'pagelines_loop_clipbox_start', 'theloop' ); //hook ?> <?php $clips_in_row = 1;?> <?php endif;?> <?php $clip_class = (($clipcount+1) % 2 == 0) ? $clip_class = 'clip clip-right' : $clip_class = 'clip';?> <div <?php post_class($clip_class) ?> id="post-<?php the_ID(); ?>"> <?php pagelines_register_hook( 'pagelines_loop_clip_start', 'theloop' ); //hook ?> <div class="clip-meta fix"> <?php if(pagelines_show_thumb( get_the_ID(), 'clip' )): // Thumbnails ?> <?php get_the_image(); ?> <div class="clip-thumb"> " rel="bookmark" title="<?php _e('Link To', 'pagelines');?> <?php the_title_attribute();?>"> <?php the_post_thumbnail(array( 200, 200 ));?> </div> <?php endif; ?> <div class="post-category"><?php the_category(' / '); ?> <div class="clip-header"> <?php pagelines_get_post_title('clip');?> <?php pagelines_get_post_metabar('clip');?> </div> </div> <?php if(pagelines_show_excerpt( $post->ID )): // Excerpt ?> <div class="post-excerpt"> <?php the_excerpt(); echo get_continue_reading_link($post->ID); pagelines_register_hook( 'pagelines_loop_clip_excerpt_end', 'theloop' ); //hook ?> </div> <?php endif;?> <?php pagelines_register_hook( 'pagelines_loop_clip_end', 'theloop' ); //hook ?> </div> <?php if(($clipcount+1) % 2 == 0 || $count == $post_count ):?> <?php pagelines_register_hook( 'pagelines_loop_clipbox_end', 'theloop' ); //hook ?> </div> <!-- closes .clip_box --> <?php endif; $clipcount++; endif; // End of Clips $count++; // Increment the post counter for formatting purposes. endwhile; // End of 'The Loop' // or if no posts... } else { ?> <div class="billboard"> <?php if(is_search()):?> <h2 class="center"><?php _e('No results for ', 'pagelines');?>"<?php the_search_query();?>"</h2> <p class="subhead center"><?php _e('Try another search?', 'pagelines');?></p> <?php else:?> <h2 class="center"><?php _e('Nothing Found','pagelines');?></h2> <p class="subhead center"><?php _e('Sorry, what you are looking for isn't here.', 'pagelines');?></p> <?php endif;?> <div class="center fix"><?php get_search_form(); ?> </div> </div> <?php }

thanks in advance for your help -carolyn

Share this post


Link to post
Share on other sites
bryan-hadaway

Official bump. Thanks, Bryan

Share this post


Link to post
Share on other sites
Andrew

@Carolyn this thread is long and confusing. If you have a specific question, can you please post it in a new thread. Also, please give us specific questions about issues, as we can't help you with tasks as general as "help you create recent posts".. but we can help you "write a query that will get recent posts"... see my point? Closing topic.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×