sanderpinkse 0 Report post Posted May 30, 2011 I'd like to use a modified version of section.postsinfo.php (to set up a proper header for a page that displays the results of a query for a custom taxonomy). That works fine if I modify section.postsinfo.php directly in Platformpro, but when I put a copy in my Platformbase child theme -- the preferred way, of course -- WordPress still uses the file from Platformpro. It doesn't matter if I place my modified section.postsinfo.php in a 'sections' folder or a 'wp' sunbfolder. Can anybody enlighten me? Cheers, Sander Share this post Link to post Share on other sites
cmunns 16 Report post Posted May 30, 2011 You should be adding a file called template.postsinfo.php to the root of your Base theme. What goes inside of it for editing is ONLY what is inside of the section_template function of the original section.postsinfo.php Share this post Link to post Share on other sites
sanderpinkse 0 Report post Posted May 31, 2011 Ah... That solved my problem. Now it works like a charm. Thanks a lot! Share this post Link to post Share on other sites
evert100 1 Report post Posted May 31, 2011 @Adam: How does this work for for instance the file library.templates.php? I made about 6 or 7 file customizations. Is there a standard rule of re-naming the files? Share this post Link to post Share on other sites
cmunns 16 Report post Posted May 31, 2011 library.templates.php shouldn't be touched. All the functions in that file have filters so that you can modify them in the functions.php file of your child theme. What is an example of something you changed? Share this post Link to post Share on other sites
evert100 1 Report post Posted May 31, 2011 Adam, primarly translations to Dutch like this: "if(pagelines_option('byline_author')){ $metabar .= sprintf( '<span class="sword">%s</span> [post_author_posts_link] ', __('door','pagelines') ); } if(pagelines_option('byline_date')){ $metabar .= sprintf( '<span class="sword">%s</span> [post_date] ', __('op','pagelines') ); } Share this post Link to post Share on other sites
evert100 1 Report post Posted May 31, 2011 And other files also for translation. Is there a more subtle way of doing this? Share this post Link to post Share on other sites
timlinson 3 Report post Posted May 31, 2011 You can tweak the byline via the `pagelines_post_metabar` filter. There's an example of it here: http://www.pagelines.com/forum/topic/8338 Share this post Link to post Share on other sites
timlinson 3 Report post Posted May 31, 2011 You can tweak the byline via the `pagelines_post_metabar` filter. There's an example of it here: http://www.pagelines.com/forum/topic/8338 Share this post Link to post Share on other sites
evert100 1 Report post Posted June 1, 2011 Don't know what happened, but after following the example in the topic you named Tim my website froze and i couldn't login to admin. Big stress. Took me a couple of hours to restore the whole thing. I feel uncomfortable with these hooks. I need a step by step guide, because i dont get the php code enough. But I want to learn this. Is there a tutorial for dummies? So i can learn to make hooks, actions and custom page templates? Share this post Link to post Share on other sites
catrina 103 Report post Posted June 2, 2011 Have you seen this tutorial?: http://www.pagelines.com/docs/base-child-theme If the tutorial is still unclear, we can help you out with the steps you don't understand. Please read the docs before posting. Please do not private message me unless I ask you to. Designer | Catrina Dulay Founder | Catrina and Mouse Share this post Link to post Share on other sites
evert100 1 Report post Posted June 2, 2011 Catrina, i would appreciate some step-by-step help. To begin simple. I changed (just for dutch translation) the following in comments.php if ( have_comments() ) : ?> <h3 id="comments-title"><?php printf( _n( '1 reactie op %2$s', '%1$s reacties op %2$s', get_comments_number(), 'pagelines' ), number_format_i18n( get_comments_number() ), '' . get_the_title() . '' ); ?></h3> I changed this in platformpro file. Can you guide me how to do this in the platformbase file? Thanx. Share this post Link to post Share on other sites
sanderpinkse 0 Report post Posted June 2, 2011 Hi Evert, If translation is the main point, can't you simply edit the .po and .mo-files? That would save a lot of hassle... Share this post Link to post Share on other sites
evert100 1 Report post Posted June 2, 2011 I just want to know, as ? simple starting point, how to do this in THE platform base and then move on to more complicated matters. This most be possible THE way i want isn't it? So Catrina or someone can you give me ? specific plan how to do this simple thing. Cheers Share this post Link to post Share on other sites
Kate 3 Report post Posted June 2, 2011 Hi Evert, Basically, what you would do is copy your file from platformpro to platformbase. Then, simply modify it in platformbase. For some files, it's necessary to maintain the same file structure as is in platformpro. (For instance, if a file is in platformpro/sections, you would need to create platformbase/sections for the file.) Share this post Link to post Share on other sites
evert100 1 Report post Posted June 3, 2011 I don't get it. Adam spoke about renaming section.postsinfo.php to template.postsinfo.php, and putting it in the root of base Is there a summary which files need a file structure and which don't? Or is it just trial and error? Is there a risk? Last time i got a total crash and it took me several hours to recover.... cheers Share this post Link to post Share on other sites
catrina 103 Report post Posted June 3, 2011 You should rename section.postsinfo.php to template.postsinfo.php and then put it in the root of base. If that doesn't work, try Kate's instructions. Please read the docs before posting. Please do not private message me unless I ask you to. Designer | Catrina Dulay Founder | Catrina and Mouse Share this post Link to post Share on other sites
evert100 1 Report post Posted June 4, 2011 Hi Catrina, i followed your instructions. The result is that the postinfo doesn't load and the sidebar doesn't show up. Trying Kate's instructions doesn't have any effect. So following the filestructure etc. Dreamweaver asks if i want to change the links but that doesn't have any effect also. What is next? Why doesn't this just work the way Adam described? By the way putting comments.php in the root of base DOES work! Any ideas? Thanx Share this post Link to post Share on other sites
catrina 103 Report post Posted June 4, 2011 Going back to Sander's response: If translation is the main point, can't you simply edit the .po and .mo-files? That would save a lot of hassle... Have you already tried editing the .po files if you're translating? Please read the docs before posting. Please do not private message me unless I ask you to. Designer | Catrina Dulay Founder | Catrina and Mouse Share this post Link to post Share on other sites
evert100 1 Report post Posted June 4, 2011 Hi Katrina, No i didn't try to edit THE translation files. I See this, ad i wrote before, as ? starting step to more complicated customations. Since both suggestions don't Deen to work. I like to know more about working with hooks. Since working with ? chips thema is more simple i'd like to know how to handle pro files for this purpoae in THE base folder. Glad if you coups answer To this question. Cheers Share this post Link to post Share on other sites
evert100 1 Report post Posted June 5, 2011 last post bit chunky because of Iphone corrections. Seems like i was drinking :-) Hope that you can give me a direction how to do this with filters. Is that possible? Thanx again. Share this post Link to post Share on other sites
sanderpinkse 0 Report post Posted June 5, 2011 Hi Evert, Template overrides should work fine for what you are trying to do. Maybe a small real life example will help. I wanted to disable the post navigation for a specific custom post type on my site. For that, I needed to override section.postnav.php (in platformpro/sections/wp). This is the complete contents of that file: <?php /* Section: PostNav Author: Andrew Powers Description: Paginates posts, shows a numerical post navigation Version: 1.0.0 */ class PageLinesPostNav extends PageLinesSection { function __construct( $registered_settings = array() ) { $name = __('Post Navigation', 'pagelines'); $id = 'postnav'; $settings = array( 'type' => 'main', 'description' => 'Post Navigation - Shows titles for next and previous post.', 'workswith' => array('main-single', 'main-default'), 'folder' => 'wp', 'init_file' => 'postnav', 'icon' => PL_ADMIN_ICONS . '/map.png' ); parent:GDN__construct($name, $id, $settings); } function section_template() { ?> <div class="post-nav fix"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span> </div> <?php } } /* End of section class */ I created a file named template.postnav.php in my platformbase folder. All I added to that file was what's below: <?php if( 'XXXXX' !== get_post_type() ): ?> <div class="post-nav fix"> <span class="previous"><?php previous_post_link('%link') ?></span> <span class="next"><?php next_post_link('%link') ?></span> </div> <?php endif; ?> 'XXXXX' is of course the name of my custom post type. Basically, all you should include in the override template (template.postinfo.php in your case) is the very bit of code you want to customize. If anything goes wrong, simply delete or rename the override template, and your site will be back to its old self. Hope this helps somewhat. Cheers, Sander Share this post Link to post Share on other sites
evert100 1 Report post Posted June 5, 2011 @Sander, big thanks. Now i got it to work. Just the chunk of code you want to change is the key! By the way are you dutch like me? Cheers Share this post Link to post Share on other sites
evert100 1 Report post Posted June 5, 2011 Sander can you put this topic to 'resolved"? please? I can't because you started it. Thanx again. Share this post Link to post Share on other sites
sanderpinkse 0 Report post Posted June 5, 2011 Hi Evert, Glad I was able to help. I changed the status to 'resolved'. And indeed, I am Dutch... Share this post Link to post Share on other sites