Jump to content


Photo
- - - - -

Pagelines Framework: Can I Use Hooks?


Best Answer Simon_P , 30 November 2012 - 04:51 PM

No you need to learn about wordpress conditionals ;)

http://codex.wordpre...onditional_Tags

Go to the full post


  • Please log in to reply
9 replies to this topic

#1 francescofornaro

francescofornaro

    Advanced Member

  • Members
  • 39 posts
  • Country: Country Flag

Posted 30 November 2012 - 01:16 PM

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="

Please Login or Register to see this Hidden Content

" 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,



#2 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 30 November 2012 - 01:27 PM

Of course PageLines Framework uses hooks all over the place.

 

Full list is here: 

Please Login or Register to see this Hidden Content

 

You can use the wordpress add_action() function 

Please Login or Register to see this Hidden Content

to add you code to any of those hooks.

 

Or there is a plugin to help you. 

Please Login or Register to see this Hidden Content



#3 Danny

Danny

    Is Awesome!

  • Moderators
  • 15163 posts
  • LocationManchester, UK
  • Country: Country Flag

Posted 30 November 2012 - 01:32 PM

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 - 

Please Login or Register to see this Hidden Content

 

We also have a plugin called Action map, also free via the store and this displays all hooks available on the page - 

Please Login or Register to see this Hidden Content



#4 francescofornaro

francescofornaro

    Advanced Member

  • Members
  • 39 posts
  • Country: Country Flag

Posted 30 November 2012 - 01:57 PM

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... 


#5 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 30 November 2012 - 03:48 PM

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 */



#6 francescofornaro

francescofornaro

    Advanced Member

  • Members
  • 39 posts
  • Country: Country Flag

Posted 30 November 2012 - 04:38 PM

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!



#7 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 30 November 2012 - 04:42 PM

Please click the mark solved button :)



#8 francescofornaro

francescofornaro

    Advanced Member

  • Members
  • 39 posts
  • Country: Country Flag

Posted 30 November 2012 - 04:44 PM

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.



#9 Simon_P

Simon_P

    Messer

  • Administrators



  • 8388607 posts
  • LocationDevon
  • Framework Version:2.1.1
  • Country: Country Flag

Posted 30 November 2012 - 04:51 PM   Best Answer

No you need to learn about wordpress conditionals ;)

Please Login or Register to see this Hidden Content


  • francescofornaro likes this

#10 francescofornaro

francescofornaro

    Advanced Member

  • Members
  • 39 posts
  • Country: Country Flag

Posted 30 November 2012 - 04:55 PM

Done!!

 

I use the function is_single()

 

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