Editing single.php and page.php

Community Forums Forums General Discussion Editing single.php and page.php

This topic is: not resolved

This topic contains 9 replies, has 5 voices, and was last updated by  weslinda 1 year, 6 months ago.

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #31286

    abetts
    Participant
    Post count: 7

    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! :)

    #31290

    Posh John
    Participant
    Post count: 42

    Genesis 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

    #31291

    abetts
    Participant
    Post count: 7

    Thanks 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);
    }
    ?>

    #31310

    surefirewebserv
    Participant
    Post count: 69

    you can try to remove the comments with a conditional tags.

    So something like

    [php]
    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);
    }
    }[/php]

    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 Free

    #32800

    abetts
    Participant
    Post count: 7

    You mean I need to add it to functions.php?

    If so, it doesn’t work…

     

     

    #32804

    surefirewebserv
    Participant
    Post count: 69

    since 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 Free

    #32805

    abetts
    Participant
    Post count: 7

    The path is correct.

    #32809

    surefirewebserv
    Participant
    Post count: 69

    Unfortunately 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 Free

    #32813

    Kraft
    Participant
    Post count: 87

    I’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 Support

    #32884

    weslinda
    Participant
    Post count: 193

    Yeah, posting code on here is a real bear. Sometimes you have to rewrite things to make sure they are clean.


    Loving the Genesis Life!

Viewing 10 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic.