Jump to content
Sign in to follow this  
jasonlioh

Using Hooks (But Not Working)

Recommended Posts

jasonlioh

I want to add a series of social icon immediately after my posts (single post and before comments) using hooks. The one provided by PlatformPRO is a separate section, which is not I wanted.

	add_action('pagelines_inside_bottom_theloop', 'add_social_icons');
		function add_social_icons(){
			?>
			<?php dd_google1_generate('tall') ?>
		<?php }

The particular PHP line works when I activated my WordPress default theme. However, when I switch back to PlatformPRO, it doesn't. Did I call the wrong hook/place?

Share this post


Link to post
Share on other sites
catrina

Hooks should only be used in the functions.php file in PlatformBase, not PlatformPro. You'll need to activate PlatformBase first.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
jasonlioh

Catrina: Ahhh... After activating PlatformBase, the hook works! It's showing perfectly now but it's not at the place I want it to be. Any idea what's the pagelines_????? that is immediately right after the post? Untitled-3.png

Share this post


Link to post
Share on other sites
timlinson

Try `pagelines_loop_after_post_content`

Share this post


Link to post
Share on other sites
jasonlioh

Tim: Thank you, it works now but just a wee bit more to make it perfect. How do I make the button to appear on top of "Edit Post"? Untitled.png

Share this post


Link to post
Share on other sites
timlinson

In that case, I would customize the template instead of inserting with a hook. Copy the template.postloop.php file from the platformpro folder to platformbase. Open that template in platformbase and find this line (#102 in my version): `//Edit Link` Add this line above it (don't use php tags here): `dd_google1_generate('tall')`

Share this post


Link to post
Share on other sites
jasonlioh

Tim: Thank you for the suggestion and I am able to put the button at the place I want it to be. Last question, how do I make [EDIT POST] to go into a newline? With the method you provided, the [EDIT POST] is next to the Google +1 button and adding "br/" didn't work. Please advice.

Share this post


Link to post
Share on other sites
Kate

Hey Jason, The link actually has a class, "post-edit-link". So, we can add some CSS with that:

.post-edit-link{display:block;}

In addition, keep in mind that "Edit Post" only shows for those with administrative rights to do so ;)

Share this post


Link to post
Share on other sites
jasonlioh

Thanks Kate! Got it to display the way I want it to be. However, by adding the CSS code you provided, even the EDIT LINK just below my title is screwed up too. I searched for the line of code in the template.loop file but there's no, only the one at the bottom of the post. Untitled-2.png

Share this post


Link to post
Share on other sites
jasonlioh

Catrina: Here it is, Jason Mumbles but I have currently reverted the changes made, so you won't see it. However, to help you, if I added

.post-edit-link{display:block;}

into my custom CSS, the EDIT LINK right below my post title will end up just like the print screen above.

Share this post


Link to post
Share on other sites
catrina

The display:block is breaking the link up instead of adding a break before the link. Perhaps you can try this instead:

.post-edit-link {margin-top: 20px; margin-left: -30px;}

Adjust the top and left margin values until the link is in the place you want.


Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
jasonlioh

Catrina: Got it! Thank you very much!

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  

×