Jump to content
Sign in to follow this  
mariaaguilar

Sharing and comments on Post Footer, extra header on top of branding?

Recommended Posts

mariaaguilar

Hi all, I've just started using the child theme (PlatformPro), so I'm a huge noob when it comes to the hooks, etc. I've read several threads about getting this done, but I can't seem to wrap my head around it. After several hours, I thought I should get some help before I drive myself insane. Currently, the sharing icons only show on the single posts page (default). The image below is what I'd like to have on my home/posts page. I'd like to have the sharing icons visible as well as a link to the comment area (I'm using Disqus if it makes any difference). platforminq01.jpg My second inquiry is right after I did the update to 1.3, there is now an extra bar(?) on top of my header that seems to pull a line from the actual blog post. However, this is only present in some posts, not all of them. Am I missing something...? I went through the posts individually and nothing seems amiss... I've been going nuts trying to see where that came from and I can't find it. Please help! Thanks in advance, awesome Pageslines Forum. :)platforminq02.jpg

Share this post


Link to post
Share on other sites
cmunns

The second issue might be caused by a plugin, but a live link will help us to trouble shoot. For the first instead of using a hook you can copy the section.sharebar.php file from the parent theme in sections-wp-section.sharebar.php into the root of the base child theme. This should allow you to edit the code. What you will want to edit is this line: `'workswith' => array('main-single', 'main-default'),` change it to this and you should have a new section `'workswith' => array('main-single', 'main-default', 'posts'),` and that should give you a draggable section for the posts page content area.

Share this post


Link to post
Share on other sites
mariaaguilar

Hi Adam, thanks for replying. You'll be able to see the extra bar on this post: http://mariaaguilar.ca/my-kor-water-bottle/ along with a few others. I'm a bit confused at the first part: I can see the wp-section.sharebar.php from the parent theme. Where and how do I copy this into the root of the base child theme? If I'm understanding you correctly, once I copy it and change the line you indicated above, I should have an extra section when I edit my templates? I can just dd it onto the "Posts Pages" under the content area, right? Sorry, you'll have to excuse my confusion and inexperience. Thanks.

Share this post


Link to post
Share on other sites
Andrew

Maria, Lets just add with a look, like you mentioned. You want to add it to the posts page and right after the sharebar, correct? So do it as follows: ` add_action('pagelines_after_sharebar', 'marias_cool_hook'); function marias_cool_hook(){ if(is_home()): this html will be added where you want (I hope!) endif; } ` Make sure you are using a good text editor,

Share this post


Link to post
Share on other sites
mariaaguilar

Andrew, Right now I don't have a share bar on my posts page (it only shows on the single posts page). I'd like to add a share bar and also the number of comments + leave a comment link (like this:

<?php comments_popup_link('0', '1', '%'); ?> |</b> #respond">Leave a Comment</b>[/code]

- Just not sure where I should plug that in. Also, when I tried modifying the functions page, I got an error and had to re-upload the functions.php. Otherwise, the site would not load. I really hope someone can help. I've been spending far more coding than I thought I would have been and frankly borderline regretting purchasing Platform Pro at this point.

Share this post


Link to post
Share on other sites
bryan-hadaway

Wait for further developer help. Thanks, Bryan

Share this post


Link to post
Share on other sites
cmunns

Okay well this exact code will get you the sharebar on your main posts page. ` add_action('pagelines_loop_post_end', 'add_sharebar'); // function name function add_sharebar(){?>

<?php e_pagelines('post_footer_social_text', '');?>
<?php $upermalink = urlencode(get_permalink()); $utitle = urlencode(get_the_title()); ?> <?php if(pagelines_option('share_reddit')):?> Reddit <?php endif;?> <?php if(pagelines_option('share_facebook')):?> Facebook <?php endif;?> <?php if(pagelines_option('share_twitter')):?> <?php $title = get_the_title($post->ID);?> Twitter <?php endif;?> <?php if(pagelines_option('share_delicious')):?> Delicious <?php endif;?> <?php if(pagelines_option('share_mixx')):?> Mixx <?php endif;?> <?php if(pagelines_option('share_stumbleupon')):?> StumbleUpon <?php endif;?> <?php if(pagelines_option('share_digg')):?> Digg <?php endif;?>
<?php } ` Add it just after this line: `require_once(TEMPLATEPATH . "/core/core.init.php");`

Share this post


Link to post
Share on other sites
mariaaguilar

Thanks Adam, I ended up using a different plugin for the share icons that did what I needed it to. But, I am trying to use the same hook and function you provided in order to have the "Leave a Comment" link on the posts pages. It is working, but it also shows on the single posts and Pages (which I don't want it to do) - any chance you can modify it so it only shows on the posts, but not the single posts? Would really appreciate it. (Hope that made sense!) Also, I am still having trouble with the extra bar that shows up on top of everything. I can't figure out where it came from?

Share this post


Link to post
Share on other sites
kastelic

Try wrapping the whole thing with an if statement:

`
	<?php if(!is_single()){ ?>
	
	//code here
	
	<?php } ?>
	`

Share this post


Link to post
Share on other sites
mariaaguilar

Hi all, I decide to revisit this issue after several weeks of thinking that it was okay that the new comment link was okay to be showing on the Pages (it is really bothering me now!). Here is the code I have on my functions.php file:

add_action('pagelines_loop_post_end', 'add_commentlink');
	
	function add_commentlink(){?>
	
	<div class="post-footer">
	
		<div class="left">
	
		</div>
		<div class="right">
	<?php comments_popup_link('0', '1', '%'); ?> |</b> #respond">Leave a Comment</b>
		</div></div><?php }[/code]

I just need it to NOT show up on pages, otherwise it's perfect. I tried to experiment using different hooks, but no luck. I also tried wrapping the whole thing with an "if" statement, but that gave me a syntax error? Here's a link if it helps: http://mariaaguilar.ca/ Also, the my initial problem of the second mystery bar was indeed a plugin issue (fixed now). Thanks!

Share this post


Link to post
Share on other sites
kastelic

wrapping with an if statement will do what you want. The syntax error is because its not typed in right. Try this:

function add_commentlink(){
	if if(!is_single()){
	?>
	
	<div class="post-footer">
	
	 <div class="left">
	
	 </div>
	 <div class="right">
	 <?php comments_popup_link('0', '1', '%'); ?> |</b> #respond">Leave a Comment</b>
	 </div></div><?php }}

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  

×