Create New Page Template

Community Forums Forums General Discussion Create New Page Template

This topic is: not resolved

This topic contains 25 replies, has 5 voices, and was last updated by  marybaum 1 year, 7 months ago.

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #26115

    Bill Murray
    Participant
    Post count: 575

    @marybaum – There’s no PHP errors in the code you posted in the pastebin; it runs fine for me. However, note that on line 24 you are removing the loop. If you do that, you won’t display any page content.

    I just now read your comment that the code works, but I don’t see a difference between what you posted here and what you posted on pastebin. As long as your comments are opened and closed properly, their location doesn’t matter.

    For your breadcrumb issue, your remove action is wrong. Change it to:

    remove_action( ‘genesis_before_loop’, ‘genesis_do_breadcrumbs’ );

    For both, whenever you get parse errors or PHP errors, they have nothing to do with your CSS. You can specify ID’s and classes in your PHP code that don’t exist, and that won’t produce an error. To get a PHP error, your code has some basic flaw – such as a typo, an unclosed () or { }, a missing ; at the end of a line.

    Hope that helps.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #26119

    BennettGlobal
    Participant
    Post count: 16

    Hey Bill,

    That one change did not work, I still get the error code, but after reading your tutorial code its identical to what I want to do other than the name.  I think I’m going to give it a try.

    Michael

    #26120

    Bill Murray
    Participant
    Post count: 575

    @BennetGlobal – I didn’t post a tutorial; I think that was in Brad’s post.

    One other thought is that your text editor is inserting something on line 12 because of its length. You might want to check out PHP editors, such as Notepad++. Other than the glitch I commented on, there’s nothing in the code that would generate an error.

    You can test that theory by temporarily replacing line 12 with:

    if ( is_active_sidebar( ‘entertainment-top’ )) {

    It will have the same impact as long as you put a widget in that widget area.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #26121

    marybaum
    Participant
    Post count: 131

    Thanks, Bill! It does work.

    I’ll change the breadcrumb-remove – though I think I may want to keep it. Only problem is that having removed all the content, it shows up below my widgets, and I’m not clear from looking at the hook reference which one would get it above them. Did I miss a before_wrap hook? Can I invent hooks? Like before_featured_area?

    Thanks again for looking at the code!

    Michael, looking forward to the end of your magazine journey.

    Night all . . . I’ll check in in the morning.

    Mary


    Be it ever so run down, there’s no place like FriendFeed. ;-)

    #26125

    Bill Murray
    Participant
    Post count: 575

    @marybaum – No, unfortunately you can’t invent hooks – unless you want to take the time to write the code to make them work, which would really involve modifying Genesis, which you shouldn’t do. I think you want to change where you add your custom function:

    add_action( ‘genesis_meta’, ‘minimumFRC_tourney_genesis_meta’ );

    You’re adding them in genesis_meta, and that’s way too soon. That’s why they appear before your header. Try a hook that comes later. A really quick guess is genesis_after_content, but I’m not sure how that will work since you removed the loop.

    One note on hooks: you always have to look at your child theme to see if it has relocated something that is normally in 1 place and put it in another. For example, if nav menus are normally below the header, but the child theme has relocated them to before the header, and you use a remove action from a tutorial that assumes the normal placement, it won’t work – because the nav menus aren’t in the place expected by the tutorial author. That’s especially true since your functions.php gets executed before your page template.


    Web: https://wpperform.com or Twitter: @wpperform

    We do managed WordPress hosting.

    #26126

    BennettGlobal
    Participant
    Post count: 16

    Hey Bill,

    Sorry about the tutorial mix up.  I’m so tired, I can’t keep my eyes open.  I will test the code in the morning…I’ve been at this for 18 hours.  My eyes are shot.

    Michael

    #26127

    BennettGlobal
    Participant
    Post count: 16

    Now I’m really stumped.

    Re-did my Custom Home Page Template (the one I call Entertainment) using Brad’s code as a test.  My previous line 12 error is now on line 9 but the same message.  It’s the exact same line of code in both error messages.

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );\

    I’m stumped.  Any ideas what I should do?  I will check tomorrow.  I’ve been at this for 18 hours trying to solve this and my eyes are shot.

    Thanks,

    Michael

    Parse error: syntax error, unexpected T_STRING in /home/bgeinc/public_html/wp-content/themes/genesis/page_entertainment.php on line 12

    Parse error: syntax error, unexpected T_STRING in /home/bgeinc/public_html/wp-content/themes/magazine/Entertainment.php on line 9

     

    #26128

    marybaum
    Participant
    Post count: 131

    (double submit removed.) I hit Submit and get a 404, then hit it again and don’t realize the system’s accepted my Submit!


    Be it ever so run down, there’s no place like FriendFeed. ;-)

    #26129

    marybaum
    Participant
    Post count: 131

    So this is the line that’s stumping you, right?

    remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );\

    Try getting rid of the backslash at the end of the line, after the semicolon.

    That just might be your whole problem . . .

    Gnight …

    MB


    Be it ever so run down, there’s no place like FriendFeed. ;-)

    #26924

    BennettGlobal
    Participant
    Post count: 16

    MB, Bill, Brad,

    Well, I have finally solved my problem.  That / mark after this— remove_action( ‘genesis_loop’, ‘genesis_do_loop’ );\ was the problem.  As I examined the code further, it appears that when I copied the code into my php folder it placed a / mark after several lines of code and gave me a continuous set of error codes, so I removed all of them and it works fine now.  I feel incredibly stupid putting you all through this, but I’m now off to the races.

    Thank You All…

    Until I need you again (which I’m sure I will)

    Michael

    #27215

    marybaum
    Participant
    Post count: 131

    Never fear, Michael.

    I think my original problem was a version of the same thing – one line had Pa after the semicolon that got there (I think) when I thought I was typing into a signup form or something on my other monitor.

    I also had a situation yesterday where some content wouldn’t go into a middle widget on a home page. Of course not – I had uploaded an old copy of the home.php file that didn’t HAVE a middle widget, because I had written the middle widget into the server version instead of the local version without realizing it, then uploaded the local copy to overwrite it . . . D’oh!

    Fortunately, a lot of what I call writing, in this case, was mostly copy-paste-change. So it wasn’t a big deal to redo it on the local version and then upload.

    Have a great weekend!

     

    Mary


    Be it ever so run down, there’s no place like FriendFeed. ;-)

Viewing 11 posts - 16 through 26 (of 26 total)

You must be logged in to reply to this topic.