Tagged: delete templates, template list modifying, templates
-
AuthorPosts
-
April 7, 2024 at 3:37 pm #1439405
Hi
2 questions
1: how / where do I delete page template on the template list?
2. A template I built is not showing the content (title / blog) it should: Meinung Seite ist the template name.
See: https://jmbuettner.ch/meinung/?preview_id=101&preview_nonce=c38b70099c&preview=true&_thumbnail_id=559
the same content is visible if I to set the page on standart template.please note that php has been modified by you on my request for full content of blog (see last thread).
regards
DominicApril 7, 2024 at 4:03 pm #1439410
see screenshot of templates I can’t delete:
https://www.picdrop.com/buettner/JPdWMtQHhH- This reply was modified 8 months ago by dbuettner.
April 7, 2024 at 9:42 pm #1439437Hi,
These are the default template options:
the Default Template is the file template-builder.php and can not be removed.
To remove the other ones:
Archives
Blank – No Header, no Footer
LayerSlider Blank Template
Add this code to the end of your child theme functions.php file in Appearance ▸ Editor:function remove_layerslider_template( $templates, $theme, $post ) { unset( $templates['layerslider-blank'] ); unset( $templates['template-archives.php'] ); unset( $templates['template-blank.php'] ); return $templates; } function adjust_template_filter() { remove_filter( 'theme_page_templates', [ 'LayerSliderClass', 'add_templates' ], 10, 3 ); add_filter( 'theme_page_templates', 'remove_layerslider_template', 10, 3 ); } add_action( 'init', 'adjust_template_filter' );
when you add this the meta box will not show in the backend because there is no choice to be made, the Default template will be used.
If you add your own template the meta box will then show, for example I created a file named my-template-blank.php with the Template Name: My Blank Template:
and now the meta box shows with this option:
If you also want to remove the LayerSlider blank template meta box:
Add this code to the end of your child theme functions.php file in Appearance ▸ Editor:function remove_layerslider_meta_box() { remove_meta_box( 'ls-page-meta-box', 'post', 'side' ); remove_meta_box( 'ls-page-meta-box', 'page', 'side' ); } add_action( 'add_meta_boxes', 'remove_layerslider_meta_box', 11 );
Best regards,
MikeApril 7, 2024 at 11:59 pm #1439449Hi,
ok, quite complicated for me…
in fact I do just want to remove one of the template I did by mistake (Meinung template) and my 2. question is more relevant:The template I built (Meinung_seite) is not showing the content (title / blog) it should:
See: https://jmbuettner.ch/meinung/?preview_id=101&preview_nonce=c38b70099c&preview=true&_thumbnail_id=559
the same content is visible if I to set the page on standart template.What do I have to change to use my own template for the blog?
regards
DominicApril 8, 2024 at 12:28 pm #1439489Hi,
You are using a blog element on a page to show your bolg. you are not using a “template” you don’t need to remove the other “templates” and you don’t need to “add” templates.
The reason you page doesn’t show correctly is because to set the page as the default blog:
this is not the setting you want, I correct it for you:
I corrected your “template” error and now you page shows correctly.
Please remove your “templates” this is not the correct approach.Best regards,
MikeApril 8, 2024 at 7:51 pm #1439527Hi Mike
thanks for your help. Unfortunately I’m afraid to make a mess or kill the page by deleting myself the wrong templates with the php code you gave me. So if it is necessary to delete them, please do it vor me.
You may delete the following template: MEINUNG template and Meinung_Seite.
see screenshot: https://www.picdrop.com/buettner/JPdWMtQHhHDanke !
regards
DominicApril 9, 2024 at 12:36 am #1439536Hi,
I don’t know how you added the MEINUNG and Meinung_Seite templates, I don’t see them as I would expect, so you will need to remove them, not with the function above but however you added them in the first place. If you don’t remember how you added them then nevermind.Best regards,
MikeApril 9, 2024 at 9:41 am #1439561Hi Mike
Just for your info. I managed to add templates through the link to standard-template right of a page on the enfold theme (as it was in the beginning). This option does not exist on the child theme. BUT: there is no: undo. You can create a template but not delete…
I aded you 3 screenschots from another WP page I’m working on. https://www.picdrop.com/buettner/JPdWMtQHhH
You may download the screenshots as I will deactivate the link within one week.Now you know something new in enfold even you know probably everything.. :-)
greetings and many THANKS for your support.
Dominic- This reply was modified 8 months ago by dbuettner.
April 9, 2024 at 12:29 pm #1439573 -
AuthorPosts
- You must be logged in to reply to this topic.