WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] TwentyEleven custom page theme, loop, child (8 posts)

  1. jknetdesign
    Member
    Posted 2 years ago #

    Yes this is already a child theme and I don not have a link because it is on MAMP.

    See Morten's video on TwentyTen custom templates. http://www.youtube.com/watch?v=pvzx9k61X1M

    I started with page.php to name a custom template. What file should I pull the if statement from that is equivalent to loop=page.php?

    I'm intrigued with this professional method. Any php advice is appreciated.

  2. jknetdesign
    Member
    Posted 2 years ago #

    Any one have some knowledge on this topic of custom page templates?

  3. WPyogi
    Volunteer Moderator
    Posted 2 years ago #

    The Codex is very helpful on this -- look up templates.

  4. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    I started with page.php to name a custom template. What file should I pull the if statement from that is equivalent to loop=page.php?

    can you try to ask or explain that in different words? I have no idea what you mean.

    are you referring to 'get_template-part()' ??

  5. jknetdesign
    Member
    Posted 2 years ago #

    Let's say I want to add a custom class like a wider .entry-content on one page. I know I can add a style:

    .page-id-5 .entry-content {
    max-width: 217px;
    padding: 0;
    }

    But I want to do it the right way replace the content in a template with .entry-custom or something and control it through a page-home.php.

  6. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    these might help:

    a:
    body_class() http://codex.wordpress.org/Function_Reference/body_class has a page template specific css class output:
    .page-template-templatefilename-php

    b:
    there is a conditional tag to check for the used page template:
    http://codex.wordpress.org/Conditional_Tags#Is_a_Page_Template

  7. jknetdesign
    Member
    Posted 2 years ago #

    I've been using page.php for my templates and pulling statements from content-page.php. So I believe page.php is the file to rename custom-page.php and add a template name.

  8. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    So I believe page.php is the file to rename custom-page.php and add a template name.

    seems ok;

    create a copy of page.php, and save it as custom-page.php; then ad the Template Name part.

Topic Closed

This topic has been closed to new replies.

About this Topic