• Resolved yoshid

    (@yoshid)


    hey everyone, I hope somebody will be able to help me out.

    I’m trying to create a custom page template which I would then apply to my home page. I am replicating sidebar-page.php and giving it a new name home-page.php.
    in home-page.php I’ve changed the template name to Homepage Template.
    I then choose Homepage Template from the dropdown menu in wp-admin applying it to the page I created.
    the problem I’m having is that even though my new template includes a sidebar, the page shows as singular post. I haven’t changed anything in the home-page.php file except file name and templated name.
    I’m using twentyeleven as my base template.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter yoshid

    (@yoshid)

    you are Da’Man alchymyth! your script worked great.

    I am using child theme for my customization, however when I try to use functions.php from my child directory I get this error:

    Fatal error: Cannot redeclare twentyeleven_excerpt_length() (previously declared in /usr/local/pem/vhosts/112577/webspace/siteapps/20589/htdocs/wp-content/themes/ria/functions.php:318) in /usr/local/pem/vhosts/112577/webspace/siteapps/20589/htdocs/wp-content/themes/twentyeleven/functions.php on line 320

    if I edit functions.php in twentyeleven theme it works fine. as you pointed out, it’s better not to edit the template theme, but it’s the only way I can get it to work.

    I really appreciate you help. thanks a lot.
    paul

    only use new functions in functions.php of your child theme; don’t copy the full functions.php file.

    some functions need to get corrected with unsing filters, others are pluggble, i.e. can be overwritten with a different function in functions.php pof a child theme.

    difficult to explain in general – please ask again with details.

    my article was explicitly using codes that you can add to a fresh functions.php in a child theme – just make sure to start the functions.php file with

    <?php

    and to end it with

    ?>

    (nothing before the first one and nothing after that last code)

    Thread Starter yoshid

    (@yoshid)

    thanks again for pointing me in the right direction. I’ve set up a proper child functions.php file, registered new widgets, I’m good to go.
    cheers
    paul

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Custom page templated problem’ is closed to new replies.