Jump to content


Photo
- - - - -
Resolved

Add javascript codes to the end of post metabar

post metabar javascript

  • Please log in to reply
5 replies to this topic

#1 colintsui

colintsui

    Member

  • Members
  • 28 posts

Posted 02 October 2012 - 11:04 AM

Hello I'd like to edit the theme file containing the post metabar to include some javascript, preferrably inside the loop.php (because need to use php to call permalink and post title for each post) but i couldn't find this file, would you please advice me which file to edit? I've already created a child theme for this purpose.

Thanks in advance

#2 Danny

Danny

    Is Awesome!

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

Posted 02 October 2012 - 12:02 PM

Hi Colin,

This will most likely require the use of a hook. Therefore, can you provide the code you wish to add and we can point you in the right direction.

#3 colintsui

colintsui

    Member

  • Members
  • 28 posts

Posted 02 October 2012 - 12:57 PM

Hello Danny,

here is the code:

Please Login or Register to see this Hidden Content


Thanks!

#4 Simon_P

Simon_P

    Messer

  • Administrators



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

Posted 02 October 2012 - 01:16 PM

You'd be better to use a shortcode, add this to your childtheme functions.php:

Please Login or Register to see this Hidden Content


now you can place [wieboshare] in the metabar.

#5 colintsui

colintsui

    Member

  • Members
  • 28 posts

Posted 02 October 2012 - 03:05 PM

it's like magic!! thanks a lot!!

#6 catrina

catrina

    Advocate

  • Members
  • 12345 posts
  • LocationCalifornia
  • Country: Country Flag

Posted 02 October 2012 - 05:24 PM

The topic was marked as resolved.





Also tagged with one or more of these keywords: Resolved, post, metabar, javascript