Support » Theme: P2 » P2-theme Function Overriding ?

  • Hi,
    I’m modifying P2 for a club group. One of the things I wanted to do was to change the word ‘Permalink’ to ‘Pagelink’ as all the users will be non-techies and ‘Permalink’ means nothing to them. Unfortunately this means modifying some function in functions.php.
    Is there any chance you can support function overriding (ie. wrapping the function declarations in an if statement that checks to see if the function has already been declared). This would make it so much easier to make mods and tweaks to some of the functions as I could copy them into my own functions.php file in my p2-child theme.
    Great theme though. Thanks for making it available.


Viewing 2 replies - 1 through 2 (of 2 total)
  • Ayman


    What you are looking for is to override the template using your child theme.
    Just copy entry.php from the root of p2 into the root of your child theme then on line 37 you will find the “permalink” change it there.
    Hope this helps 🙂

    Thanks for the reply Ayman. I have changed the reference in entry.php in my child theme as suggested, but this only amends the wording in the Post and not the Comments. As far as I can see the code to change the word “Permalink” in the Comments is in “function p2_comments” in functions.php.

    The code change in functions.php is the same as in entry.php..
    ><?php _e( 'Permalink', 'p2' ); ?><
    is amended to
    Unless there is any way to go deeper to where the actual word “Permalink” is listed, I can’t see any way around having to change the function.
    Any suggestions as to how I may progress on this would be appreciated.
    My website is here.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘P2-theme Function Overriding ?’ is closed to new replies.