Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 0 down vote accepted

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.
share|improve this answer
    
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.. –  a deer Sep 23 '11 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(). –  rofflox Sep 23 '11 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! –  a deer Sep 29 '11 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. –  rofflox Sep 29 '11 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 –  a deer Oct 9 '11 at 19:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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