[Resolved] Selectable Page template like Blog

Home Forums Support [Resolved] Selectable Page template like Blog

Home Forums Support Selectable Page template like Blog

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #255566
    Patrick

    Hi Tom,

    I need your help. Pleas let me know, how I can create an selectable page template, which not wrap the content primary with “inside-article”. If I create an page within wp-admin, every page is wraped with “inside article”. I need a page template for choose, which has this not. I know, I can work with simple css on this page and define some css for this page. But I need this page option sometimes more and like to have an separate page template for choosing.

    Could you please let me know how I can do this?

    I have crated an page within my child theme which is called page-no-wrap.php and put in the informations from page.php. On top I have marked it as page template with the following code:

    /* 
    *Template Name: no wrap
    */

    I can now choose this template. But what have I to do, that only the “inside-Article” all over Wrap is not shown and the paddings etc. for this inside-article are not active?

    What will I do? I like to do to make the same template like the blog view, because I have shortcode for custom posttype to insert in page and like to adapt the blog style. All is fine, but there is everytime the “inside-Article wrap wich is shown as background for my new cpt pages.

    otherwise, how can I create a page with shortcode which use archive template πŸ™‚

    Sorry if my questions are confusing. I’m confused too πŸ™‚

    thanks and regards
    patrick

    #255590
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    If you copied a template like page.php for your custom page template, you should see a line like this:

    <?php get_template_part( 'content', 'page' ); ?>

    You should replace it with something like this:

    <?php get_template_part( 'content', 'nowrap' ); ?>

    Then copy the content-page.php and add it to your child theme, and rename it to: content-nowrap.php.

    In there you can remove the inside-article class and do whatever else needs doing.

    Hope this helps πŸ™‚

    #255876
    Patrick

    Thanks for this Infos, this puts some more infos to my brain πŸ™‚

    #255935
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.