admin template selection is missing on page creation in wordpress 3.2.x - wordpress

I am using WordPress 3.2.1 ,
Page template selection drop down is missing on Pages (Add,Edit)
wp-admin > Pages >Add New > Page Attributes
I Edit the Template Page Default page as below code
/*
Template Name: New Template
*/
But still the template drop down no visible , my older version of WordPress it display by default.
Following is the screen shot for more idea

I solved this problem solved by adding the typical following code:
/*
Template Name: Custom
*/
Don't add any spaces after Name:
It'll work if you use template name: as well.

It might help someone: check if your index.php file is in place.
If it's not there, wordpress treats the template as corrupt and it doesn't display the template selection.

This should be simple to troubleshoot. The requirements for the page template to work are straight forward:
The template needs the page title in the top of the file like you've shown (the title needs to be wrapped in a PHP tag, you probably just didn't add it with your example bu I want to make sure you havne't overlooked it):
<?php
/*
Template Name: Custom
*/
?>
The second requirement is that the file is in the root of the theme folder.
With those two requirements in place, it should work. If it isn't working you nave a few possible issues. I list a few off the top of my head:
You might need to re-install WordPress in-case a file was corrupted
during your last update.
It's possible someone has altered the WP-Admin layout using users
roles.
That's all I can thing of at the moment, let me know how it turns out.

I had the same issue. It actually turned out to be a missing style.css file within the template directory in my case.
This happens because the get_post_templates() in class-wp-theme.php first checks for errors. If it finds any then it returns an empty array (no templates are displayed).
A side effect of this is that saving a page would clear the existing template and use the page.php instead.
So in short if the errors() method of your theme returns any errors then no templates dropdown.
hope that helps someone.

Same issued, I found out that in appearance panel in your WordPress dashboard the stylesheet is missing. You shouldn't rename the style.css in your theme folder.

Not sure if this will help anyone, but we solved the problem by disabling our theme and re-enabling it again. We had some other theme folders in the theme directory that we weren't using so we deleted those out as well. good luck, it's a really random problem to solve!

yeah!template dropdown not showing because you have no template So how to solve this::---
1 create template folder in theme
2 create a template in this folder
like:-
<?php /* Template Name: Home */ echo "template"; ?>
and check-in page dropdown will be there.

Related

Drupal basic page doesn’t seem to use page.tpl.php

Title says it really. Basic pages created in Drupal don’t seem to use the page.tpl.php file as a template.
If I edit the html.tpl.php file, those changes apply to every page, and it causes errors when I load a basic page.
I have also tried to copy the page.tpl.php file and name it page—basic-page.tpl.php to no avail.
Any idea what’s going on?
Also, how do I go about changing the page_top variable to include more content?
Lastly, the default page.tpl.php file has $page variables and things like $page_top and the like.
How would I call the title from the page only and the body text of a page only?
I’m using Drupal 7 and a custom sub theme.
The aforementioned files are in the template folder of the theme and I did clear caches when I added them.
Add $conf['theme_debug'] = TRUE; in settings.php and clear cache, reload page and check view source.
It will display the template file suggestions.
page.tpl.php file common for all pages. Just print anything to the tpl and run any node of basic page as well as other content type page and check if its working or not. If page.tpl.php not working for basic page only, then check your template.php file.
For print a page title just need to use following code:
<?php print $title; ?>
For print body text you need to use following:
<?php print render($page['content']); ?>
This may depend on the theme you are using. But I guess you are actually meaning page--page.tpl.php (double dashes). Which will be taken into account after you added the following snippet to your theme's template.php. Replace MYTHEME with your theme's machine name.
function MYTHEME_preprocess_page(&$variables) {
if (isset($variables['node']->type)) {
// If the content type's machine name is "my_machine_name" the file
// name will be "page--my-machine-name.tpl.php".
$variables['theme_hook_suggestions'][] = 'page__' . $variables['node']->type; // (double underscores)
}
}
See Template (theme hook) suggestions, where I also got above snippet from.
active theme debug for inspecting the template source and you get a different suggestions to user it (just avoid using node/nid).
commend drush to enable theme debug drush vset theme_debug 1

Dashicons in wordpress (frontend) won't display

I'm creating a website in WordPress. I'm using dashicons for rating (manually) holidays.
It used to work, but after update the dashicons won't be visible for non-logged in users. Only, if you login, you can see the star ratings.
The star rating should be visible on the left top of each holiday deal.
Who knows a solution?
Website url is www.ikwilopvakantie.nl
Dashicons is the official icon font of the WordPress admin as of 3.8..
To load Dashicons for non logged in users:
Open directory {your-website-folder/wp-content/themes/}
Go into the folder of your active child theme ( if you don't have active child theme, open the folder of your active parent theme )
Find there functions.php file and add the provided code at the end of it (
make sure, there isn't ?> php closing tag at the end of file. if so, just remove it ):
function ww_load_dashicons(){
wp_enqueue_style('dashicons');
}
add_action('wp_enqueue_scripts', 'ww_load_dashicons');
Save changes. Dashicons will loads on your website for all users.
EDIT: there may be some plugin/code, which removed Dashicons from pages. Try to change your code with this one:
function ww_load_dashicons(){
wp_enqueue_style('dashicons');
}
add_action('wp_enqueue_scripts', 'ww_load_dashicons', 999);
Try this:
<span class="bx-next dashicons dashicons-arrow-right-alt2"></span>
'dashicons-arrow-right-alt2' is the class of the icon.
You can find them here: https://developer.wordpress.org/resource/dashicons/#arrow-up-alt
This has to go to your functions.php file:
function load_dashicons(){
wp_enqueue_style('dashicons');
}
add_action('wp_enqueue_scripts', 'load_dashicons');
For me the problem was simply that my browser blocker addons weren't allowing the source of dashicons.css
If you're using the plug-in "Asset CleanUp", you can navigate to "BULK CHANGES" and easily use "Remove site-wide rule" at the line, where the url for "dashicon" is listed.
Many of the icons on the official list were appearing blank for me when defined as a value of the menu-item property in the register_post_type function.
If you open wp-includes/css/dashicons.css you will see a complete list of icons available, many of which have different names, for example dashicons-quote is actually dashicons-editor-quote.
Using these values solved the problem for me. I also found this cheat sheet to be helpful if you don't want to go digging through your source files.
Solved for me— For some reason, dashicons was only not rendering when I wasn't accessing the https:// version of the site.

Can't seem to import bootstrap into wordpress

I am trying to import a page I made in bootstrap into Wordpress and I can't seem to figure it out.
I would like someone to give me some hands-on support if they have the time. I get different results with different attempts.
I changed my index.html to home.php and suddenly the entire site goes down. Restored it again and did something else and then the site showed up without its CSS. i understood i had to create a functions.php file where i call the stylesheets but im not getting any further.
What do i need to do to succesfully import a bootstrap page as theme in wordpress?
You need to create a WP theme, or just a WP page template (in case of just one page.)
https://developer.wordpress.org/themes/template-files-section/page-template-files/
In your current theme, if you have page.php , duplicate it by saying e.g. page-custom.php
In the template header section name the template:
<?php /* Template Name: Example Template */ ?>
Below it add your bootstrap page's code, you may need to fix paths to css/js files but I am sure you will figure that out by googling.
Once you have that page as WP template. Now create a page in WordPress to which you want to apply that bootstrap template.. and in the page edit sidebar, there is section you can select that custom template you created.
see this photo:
https://developer.wordpress.org/files/2014/10/basics-page-templates-03.png
Now if you will visit the page on the front-end , that page will have bootstrap design applied from your custom template.

creating wordpress custom php page

I'm trying my make my first theme for wordpress.
Is there any possibility to create custom php page to display custom content?
Pretty much adding to WordPress another copy of the likes of single.php, post.php or 404.php.
All I want just a page to display the custom content on it.
Every tutorial I found so far uses just creating new page within WordPress.
I want to avoid it and for custom page to be enabled straight after theme activation.
The Idea is to have something like my_custom_page.php and to be able link to it after.
Is there any way of doing it?
Thanks
here is the solution to what I was looking for
http://kovshenin.com/2014/static-templates/
To achieve custom page functionality you can use page template concept of wordpress. Creating a page template is extremely easy. Create any new file in your theme and start the file with a comment block like so:
<?php
/*
Template Name: My Awesome Custom Page
*/
<h1>Hello There</h1>
You need paste php code inside this template file. When you submit for then redirection action will be page with custom template page.
Referance :
https://premium.wpmudev.org/blog/creating-custom-page-templates-in-wordpress/
Video :
https://youtu.be/1ZdHI8HuboA

Cannot add custom page template to my child theme

I'm running Wordpress 3.3.1.
I'm writing a child theme that modifies the default twentyeleven theme. Everything seems normal, except that when I add a custom page template, it doesn't appear in the add/edit screen (so I can't use it!).
To elaborate on "normal", here's what IS working:
My child theme appears and activates normally.
My CSS code (in style.css) is appearing.
My files from the template hierarchy are working (ex: front-page.php, page.php)
I've read and reread the codex, and my custom page template file ("coming-soon.php") seems to have the correct header:
<?php
/*
Template Name: Coming Soon
*/
So why won't it show up under the "Template" drop-down???
I've added custom templates dozens of times and never had this problem. The only possible difference I can think of is that I'm writing a child theme (even though the codex says this shouldn't matter), or perhaps it's a difference in the newest update of WP.
I can't duplicate what you're seeing with a clean install of WordPress 3.3.1. I have a theme with just two files, style.css, containing:
/*
Theme Name: stackoverflow-8946077
Template: twentyeleven
Version: 0.0.1
*/
#import url("../twentyeleven/style.css");
and coming-soon.php, containing:
<?php
/*
Template Name: Coming Soon
*/
get_header();
?><h1>Coming Soon</h1><?php
get_footer();
?>
the first part of which was copied from your question.
I see the template as expected:
The only things I can think of are to double-check:
the file exists on the server you're running on
the file's in the child template's directory (though it should work if it's in the twentyeleven directory)
there's no file with the same name in the twentyeleven directory, which (I think) would take precedence
the file name ends in .php
you only have a single space between "Template" and "Name:" (the regex used contains the literal Template Name:)
Failing that, the dropdown is populated by the get_page_templates function in wp-admin/includes/theme.php. Might be worth sticking some debug code in there to see if the $templates variable includes coming-soon.php.
This is an old thread. But if anyone is looking for solutions now, it may be the issue in WP 4.9. More details: Templates not working properly
In my situation, it ended up being the file permissions. I set it to 755 or whatever the standard WP permission is (in regards to security) and it worked!
Mine also ended up being the file permissions.
I set it to 777, and it worked like a charm!

Resources