Community Forums › Forums › Archived Forums › General Discussion › Editing single.php and page.php
- This topic has 9 replies, 5 voices, and was last updated 11 years ago by weslinda.
-
AuthorPosts
-
March 26, 2013 at 6:46 am #31286abettsMember
I'm trying to integrate my site with my forum using IPBWI and this is part of the install instructions...
Forum Comments - Template Replacements Important: to make Forum Comments possible, you need to edit file single.php and the file page.php in your theme's folder and need to replace the comment's function. If you are using Twentyten-Theme as template, just search for
Obviously, files in the genesis folder say not to edit them, how do I go about getting this done? Thanks! 🙂
March 26, 2013 at 6:58 am #31290Posh JohnParticipantGenesis works a little differently, so you won't have a single.php or page.php. It really depends on exactly what you are trying to achieve. You can create your own templates, or you can use hooks in your functions.php file to add/change behaviour...
Thus the heavens and the earth were completed in all their vast array. Genesis 2
March 26, 2013 at 7:07 am #31291abettsMemberThanks PJ - What I'm trying to achieve is to remove this...
<?php comments_template( '', true ); ?>
and add this...
<?php
if(get_option('ipbwi_settings_forumComments') == 1){
comments_template('/ipbwi/comments/comments.php', true);
}else{
comments_template('', true);
}
?>March 26, 2013 at 8:22 am #31310surefirewebservMemberyou can try to remove the comments with a conditional tags.
So something like
add_action( 'genesis_before','sf_comment_setup' ); function sf_comment_setup() { if ( ! is_single() ) return; remove_action( 'genesis_comments','genesis_do_comments' ); add_action( 'genesis_comments','sf_new_comments' ); } function sf_new_comments() { if(get_option(‘ipbwi_settings_forumComments’) == 1){ comments_template(‘/ipbwi/comments/comments.php’, true); }else{ comments_template(”, true); } }
That's extremely rough code, not sure if it will work or not but the gist is there. That would target all single posts.
SureFireWebServices.com | Genesis Tuts and More
Genesis Theme Starter Kit | It’s FreeApril 3, 2013 at 6:38 am #32800abettsMemberYou mean I need to add it to functions.php?
If so, it doesn't work...
April 3, 2013 at 7:38 am #32804surefirewebservMembersince your in the functions.php file, double check the paths of your ipbwi folder.
SureFireWebServices.com | Genesis Tuts and More
Genesis Theme Starter Kit | It’s FreeApril 3, 2013 at 7:41 am #32805abettsMemberThe path is correct.
April 3, 2013 at 7:47 am #32809surefirewebservMemberUnfortunately that's the extent of what I'm able to help with. I'm not familiar with IPBWI or how it integrates with WordPress.
The code I provided targets the single pages and removes the comment section, since it's not working there may be other factors at play.
I'll post to twitter to see if anyone else can help out. Sorry.
SureFireWebServices.com | Genesis Tuts and More
Genesis Theme Starter Kit | It’s FreeApril 3, 2013 at 7:54 am #32813KraftMemberI'm not familiar with it either, but just a quick double-check before anyone digs too deep.
If you copied/pasted the code as is, some of the straight quotes would have been re-rendered as fancy quotes, namely the new function (sf_new_comments). Assuming everything else is right, that would bork up everything.
Brandon Kraft
Volunteer
Blog | Twitter
Genesis eNews Extended SupportApril 3, 2013 at 1:20 pm #32884weslindaMemberYeah, posting code on here is a real bear. Sometimes you have to rewrite things to make sure they are clean.
Loving the Genesis Life!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.