Site logo

Archived topic

Selectable Page template like Blog

3 replies · Started by Patrick on December 16, 2016

Viewing posts 1–4 of 4

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

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

Thanks for this Infos, this puts some more infos to my brain :)

No problem! :)

This archived topic is closed to new replies.