0

i am modifying a P2 theme for a specific purpose, and it uses the get_template_part( 'entry' ) function to get the the whole entry html.

What i then get is the who <li> element, but i want to be able to move things around [putting meta at the end of the post, for example]. but codex has no documentation for it [that i could find]. does this mean i have to use my own entry-getting method, or making a new loop? i hope not because P2 is so well sorted.

thanks a bunch for any tip!

adir

1 Answer 1

0

Just looked in the P2 theme files. The theme loads the entry.php with the function p2_load_entry() located in inc/template-tags.php.

If you want to edit the entry.php file and want to be on the safe side if P2 releases an update, you should create a Child Theme.

  1. Create a new sub-folder inside wp-content/themes/ e.g. p2-child
  2. Inside the new folder, create a style.css with the content described in the above linked article. Be sure that you have added Template: p2 to the comment block.
  3. Copy entry.php to the new folder and edit it.
  4. Go to WordPress Admin Appearance > Themes and activate your newly created P2 Child Theme.
5
  • thanks Roman! i had actually already been to that file; dont know why i didnt remember that.. are there any objections to making a totally new theme from this one, and just renaming it and documenting that its derived from it? i dont actually want the P2 updates..
    – Adeerlike
    Commented Sep 23, 2011 at 14:21
  • No, you don't have to create a child theme. But the benefits are worth the 5minutes of work here ;). Btw. get_template_part() is just a better include(). If you want to create a modified entry.php just copy the file, rename it (e.g. entry-myedits.php) and set the include to get_template_part('entry', 'myedits'); in p2_load_entry().
    – Roman
    Commented Sep 23, 2011 at 14:44
  • what kind of benefits would you mention? just future development compatibility and such? [not that im saying its not worth it, but im just wondering if there's more to it] THANKS!
    – Adeerlike
    Commented Sep 29, 2011 at 23:06
  • Yes, just for the future. For example: I had a customer last month whose site was hacked (timthumb bug). Because the files where edited by a script, I had to re-download and re-install everything from scratch. The customer had made some changes to the theme before and I had to figure out which file was different from the original theme, checked the file for some nasty evil scriptcode and moved the diff to the new file. If I had a child-theme to work with, the required time would be halved.
    – Roman
    Commented Sep 29, 2011 at 23:21
  • mm i wanted to PM you but i guess i cant. well sorry you had to go through that, i hope ill learn from that and not wait for it to happen to me as well.... =] cheers
    – Adeerlike
    Commented Oct 9, 2011 at 19:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.