Jump to content
Sign in to follow this  
justinroffmarsh

Problem with hook (adding comments link to end of main blog page content

Recommended Posts

justinroffmarsh

In my first attempt to write a hook to go in PL Customize, I wrote the below. Nothing appears. Can you set me on the correct track by any chance? I'd like to add a link to comments after the content on the main blog page only. Justin

//Comments link at end of post
	add_action ('pagelines_loop_after_post_content', 'jrm_comments_link');
	
	function jrm_comments_link() {
		if ( comments_open() ) :
			echo '
';
			comments_popup_link( 'No comments yet', '1 comment', '% comments', 'comments-link', 'Comments are off for this post');
			echo '';
		endif;
	}

Share this post


Link to post
Share on other sites
Jenny

I'm no php guru by any means, but maybe you need a return value in there? Just guessing :)


Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites
justinroffmarsh

Isn't the result the echo statement? Or do I have to assign the result of the IF statement to a variable? Justin

Share this post


Link to post
Share on other sites
Rob

Justin, to clarify, at the end of a post you want to add comments? Or at the end of the blog page?


Former PageLines Moderator, Food Expert and Raconteur

Share this post


Link to post
Share on other sites
justinroffmarsh

I want to add a link to the comments on the article page so that visitors don't have so scroll back up to the top of the page to click through to the main article. Justin

Share this post


Link to post
Share on other sites
justinroffmarsh

Sorry, that's a link at the bottom of the main blog page -- terminating at the contents section of the article page

Share this post


Link to post
Share on other sites
batman

Hi justinroffmarsh You have in the meta bar the link "Add Comment" on top to go bottom .


Life is too short to remove USB safely ...

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  

×