Jump to content
francescofornaro

Pagelines Framework: Can I Use Hooks?

Recommended Posts

francescofornaro    1
francescofornaro

Hi All,

 

just a quesion. Is it possibile to use Hooks with Pagelines Framework?

I don't see hooks reference as I see - instead - with Platform Pro.

 

Basically, I'd like to add this code:

 

 

<blockquote>

<p style="text-align: justify;">Se vuoi, dimmi che cosa ne pensi nei commenti e ricordati di <a href="http://www.francescofornaro.com/ebook-coaching/" target="_blank"><strong>scaricare gratuitamente il mio ebook</strong></a> per sapere tutto sul <strong>coaching</strong>, su che cos'è e come può esserti utile. Buona lettura!</p>

</blockquote>

<center>

________________________

Per contattarmi compila il form.

[easy_contact_forms fid=3]

</center>

 

At the bottom of each post on my blog and I'd like to know if the theme can do that for me, automatically.

 

Thanks and best regards,

Share this post


Link to post
Share on other sites
Simon    247
Simon

Of course PageLines Framework uses hooks all over the place.

 

Full list is here: http://api.pagelines.com/hooks

 

You can use the wordpress add_action() function http://codex.wordpress.org/Function_Reference/add_action to add you code to any of those hooks.

 

Or there is a plugin to help you. http://www.pagelines.com/store/plugins/hooker/

Share this post


Link to post
Share on other sites
Danny    1,327
Danny

Hi,

 

yeah you can use hooks with PageLines Framework.

 

There are a few things you need to know before hand.

 

1. YOu will need to use either the Base child theme or the PageLines Customisation plugin both available for free via the store.

2. Add you hooks to the functions.php file that comes with both the child theme and the customisation plugin.

 

Here is a list of the available hooks - http://api.pagelines.com/hooks

 

We also have a plugin called Action map, also free via the store and this displays all hooks available on the page - http://support.pagelines.me/docs/plugins/action-map/


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
francescofornaro    1
francescofornaro

Hi, thank you.

 

I downloaded the plugin, activated it, then I went via FTP to the file function.php inside the plugin folder.

Ad the bottom of the file I added:

 

 

/* Aggiungo una funzione per pubblicare un pezzo di testo e il form per contattarmi dopo ogni articolo
function dopoarticolo()  {
echo 'test' ;
    }
   
add_action('pagelines_loop_after_post_content', 'dopoarticolo' );
 
I think the "test" word should appear just below the main content, before comments.
But I can see anything there.
 
Is there something I'm doing wrong?
 
Thanks again... 

Share this post


Link to post
Share on other sites
Simon    247
Simon

You have not 'closed' your comments should be:

/* Aggiungo una funzione per pubblicare un pezzo di testo e il form per contattarmi dopo ogni articolo */

Share this post


Link to post
Share on other sites
francescofornaro    1
francescofornaro

Now it works and I really thank you.

 

I had to use:

 

<?php echo do_shortcode("[easy_contact_forms fid=3]"); ?>

 

in order to include the shortcode. Thank you!

Share this post


Link to post
Share on other sites
Simon    247
Simon

Please click the mark solved button :)

Share this post


Link to post
Share on other sites
francescofornaro    1
francescofornaro

Wait! :))

I still have a question.

How could I load this code ONLY on posts? Because now it's loaded for posts AND pages. I don't want to load the code on pages, only post. Should I change the hook, I guess.

Share this post


Link to post
Share on other sites
francescofornaro    1
francescofornaro

Done!!

 

I use the function is_single()

 

It it's true, there's a post :)

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


×