Jump to content


Photo

Help with post layout


  • Please log in to reply
11 replies to this topic

#1 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 25 May 2011 - 01:47 AM

I am more of a designer than doing some codes but I'm trying and I don't know what php commands are used on certain stuff.

The lay out is something like this:
post layout

I assume that customising the layout is at template.postloop.php

<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-date"> <?php the_time(get_option('date_format')); ?> </div>
<div class="post-title fix">
<?php pagelines_get_post_title();?> </div>
<div class="author_cat_bar" <?php ???????????????????????????; ?> </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>

<div class="pemarmalink_share_comment_bar"> <?php ????????????????????????????; ?> </div> how to add the 'hi' image after the comment???

Where to place my links (pemarmalink, share, comment) after the post of my blog but won't appear on my other pages???

#2 timlinson

timlinson

    Advocate

  • Members
  • PipPipPipPipPip
  • 1032 posts

Posted 25 May 2011 - 04:10 AM

Where to place my links (pemarmalink, share, comment) after the post of my blog but won't appear on my other pages???

Not quite sure what you mean. What other pages? The postloop is only for post pages.

Find these 2 lines:

` `endif; // End of Full-Width Post Area`

and you can put your links right before those lines.

#3 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 25 May 2011 - 11:34 AM

Hi Tim,

I added this after <?php
endif; // End of Full-Width Post Area

<div class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'pagelines' ), __( '1 Comment', 'pagelines' ), __( '% Comments', 'pagelines' ) ); ?></div>

It's working fine on my blog page but when I go to my portfolio and about page, it says "comments off"

Check it at redchimera.com

And what are the php commands for my post to get the author, day, time and category as you can see on my post layout. Also the php commands for permalinks and sharing.

This is the post layout I want to recreate....

#4 Kate

Kate

    Advocate

  • Members
  • 3039 posts

Posted 25 May 2011 - 12:36 PM

Hi Ryan, Regarding the "comments off": On those pages, are you sure you've enabled comments? On their edit screen, look for a checkbox that says "Enable Comments", and make sure it's checked.

#5 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 25 May 2011 - 02:13 PM

Hi Kate, I'm sorry, I meant to hide "comment off" in 'about' and 'portfolio' pages. I just want them on my blog page after the post. They seem to appear on other pages and I want them disappear. Thanks.

#6 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 25 May 2011 - 02:31 PM

Is there any easier way to place 'leave comment' under the post without appearing in other pages and without editing the template.postloop.php??? thx xx

#7 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 25 May 2011 - 07:13 PM

Can't you just use the Template Setup to remove the comment section from the PAGE CONTENT AREA, but not from the SINGLE POST CONTENT AREA section respectively?

#8 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 26 May 2011 - 12:20 AM

Hi Adam, I tried but it didn't work. I think I used wrong post comment command in the template.postloop. which I think is not recommendable anyway. Can I use fuction instead to place the post-comment link under my post. I think I've seen some in the forum but I couldn't figure things out and I really have a hard time understanding hooks even though I watched the videos about it 4 times. I'm a quite dense. All I want is 'Leave a Comment' under my every post that won't appear on other pages. I used the function below that I've seen from other topic but it still shows from my other pages like 'About' function post_comments($content) { $content .= '[post_comments]'; return $content; } add_filter('the_content', 'post_comments');

#9 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 26 May 2011 - 02:41 AM

You'll need a different hook to add the "Leave a Comment" link to where you want it. Have you already seen the list of hooks under Settings > Template Setup > Posts Pages > Advanced Setup?

#10 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 26 May 2011 - 09:41 AM

Hi, yeah I've seen that and I want it placed in pagelines_after_maincontent (or is it suppose to be pagelines_after_theloop) but how will I do it? what are the codes or commands used? I'm very confused :((

#11 cmunns

cmunns

    Advocate

  • Members

  • 6537 posts
  • Country: Country Flag

Posted 26 May 2011 - 08:25 PM

You can do this using the `pagelines_after_excerpt` hook. Remember that you need to use the -Base child theme and add the hook to the functions.php file The code would be like this: ` add_action('pagelines_after_excerpt','sharethis'); function sharethis(){ //Add your content here; } ` Now this will place it at the end of the excerpt on the blog page....for adding to the single post pages you could use this hook `pagelines_loop_after_post_content` instead. ....what is the exact code you want to add?

#12 ryangangan

ryangangan

    Member

  • Members
  • PipPip
  • 13 posts
  • Country: Country Flag

Posted 26 May 2011 - 09:07 PM

Hi Adam, The code I want to use is the post_comment but I just don't know how to construct it. All I know, is that I have to place it on the child theme. Lol. I've been searching ways to place comment link under my post in the forum for ages but everytime, they show on my other pages as well. What is exactly the code I have to use to have the post_comment after the post? Thanks so much....