WordPress Page Templates Tutorial There’s over twenty custom WordPress Page Templates built into Stallion Responsive, plan to add an example of all the Page Templates to this website. WordPress Landing Page Template – Content and Archives
Continue Reading WordPress Page Templates
Facebook/Twitter on WordPress Page Template?
Hi Dave:
The Facebook/Twitter (Like/Tweet) buttons appear below each blog post, however, they appear at the beginning of each of the Static Pages. Is there a way to not display them on Static Pages?
Also, is there a way to remove tags from the Static Pages?
Thanks!
Glenn
Facebook Like Button and Twitter Tweet Button WordPress Page Template
The Facebook and Twitter links are the same for both Static Pages and Blog Posts?
Are you using one of the extra Static Page template files like the Sitemap templates? Because you don’t actually add any content to those Pages the Facebook and Twitter buttons would be at the top, but for a normal Static Page they are at the bottom.
You could make your own Page template or edit the one you are using, find
?php if(st_facebook()==1){ ?>
and you’d delete 6 lines of code ending with
?php } ?>
Or for that template change the two lines with ==1 to ==3, the buttons won’t be loaded.
You can’t by default add tags to static Pages?
I’ve added the tags code to static Pages, but it will be ignored unless you are running a plugin to add tags to static Pages.
Either you are looking at a blog Post by mistake or you are running a plugin that ads tags to Pages.
If you don’t want tags on static pages edit the pages.php file and remove the line including: ?php the_tags(); ?` You could also make a static Page template with the tags code removed if you are running a plugin which adds tags to pages.
David
Facebook Like Button and Twitter Tweet Button WordPress Page Template
WordPress Custom Page Templates
Hi Dave:
Thanks for your suggestions on removing the Social Promotion links and Tags on my static pages. I modified the code to reflect your suggested changes, however, my static pages still displayed the FB Like and Twitter Tweet links in addition to the Tags (which should only appear on the posts, right?). I guess my PHP programming skills aren’t that good!
Anyways, I was using the “Static Page No Ads” page template thus far. I thought I try out the other static page template (“Download”), and voila, it worked. No more Social Promotion links and the Tags on my static pages. Yay!
Thanks, always, for your fast responses and help!
Glenn
WordPress Custom Page Templates
WordPress Page Template Comments on Top
On one of my websites, I am experimenting with moving the comments from the bottom to the top of the page, under the title. This with Hovercards will help people who land on the page see it to function with a more social aspect. It could be a profile pages or even like classified ads/forum with no registration. I will have to title things right of course so people are not disoriented when they land on the page.
This combined with editing your language options from ‘Leave a reply to’ something like ‘Create your profile below” or ‘Comment title’ to ‘Profile title’ will change how people land on it use the page. It could also be something like ‘Leave your classified ad’ or ‘dating profile’ whatever you structure the site will be like.
The text rich content of the post will still be below, and with good copy it will hopefully attract some traffic. This will help mitigate the issue of on social sites and dating sites you have 1000s of profiles with pages that do little or have a negative SEO impact.
If your site page was about ‘meeting people in London who like Tattoos’ then you could write about London tatto culture or something. Above would be the comment stream with Hovercards of people who are into this and they would have a Gravatar profile or at least a comment rich in content.
Just and idea could be another site that does not work but if I design it right, it would do something.
I can organize these posts anyway that makes logical sense and searchable, even like a classified ads layout.
This is just an experiment. Certain pages will run this type of template, others will take a standard Post them comment style.
The problem is when I move this code:
Above to where the content is, it works but the comment box extends out too far to the right. I think it is a simple css or div thing I am missing. I tried to troubleshoot this a little but am rusty. If you have an idea where to drop this so it does not mess up my nice neat comment alignment and keep it from overlapping with the sidebar, it would be appreciated.
Maybe it would be easier for me to just create profile pages but these Hovercards look so good and it would be a unique way to use WP.
WordPress Page Template Comments on Top
WordPress Page Template Comment Form Above Main Content
I think I know the issue, if you are adding the comment code below the date of the post code you have moved it inside the div with id=”post-entry” which will mess with the padding, so yes a CSS issue.
You could edit the CSS, but an easy fix would be to close the post-entry div add the comment code and reopen the div right after it which would mean the #post-entry CSS won’t affect the comment code.
This will break HTML validation as you aren’t supposed to use an id twice (all ids are supposed to be unique), not aware of any real issues with using an id twice (browsers are smart enough to cope with it) so I’d use it for a quick fix.
Below the code:
Add this
This will result in two comment forms, so delete the corresponding code lower down the page between the if and endif.
There’s the page-example.php file for creating this type of page template and with the Stallion 7.0 Page templates work with blog Posts as well, so you won’t have to limit this type of page to static Pages only.
BTW not sure if you tried to add code to your comment, if you did it would be stripped if you didn’t surround it with code tags (an opening and closing code tag set).
An interesting idea, I saw a plugin (or code snippet, forget which) that strips the content from multiple page commented posts. The main post (page 1) shows the full content on the post and the comments for that page, comment page 2, 3, 4 etc… only shows the comments for pages 2, 3, 4 etc… which means there’s less duplicate content generated by having multiple page comments. WordPress core (and Stallion) adds a canonical URL to pages 2, 3, 4 etc… to the main page so Google etc… considers all of the comment pages as the main page. I was thinking removing the content od comment pages 2, 3, 4 etc… would be a bit like a forum output with page 1 describing what the thread is about. Plan to add the code to Stallion as an option.
David
Update: the above is a page template within the Stallion Responsive theme.
WordPress Page Template Comment Form Above Main Content
WordPress Sales Page Template
Hi David,
In one of my sites, I’m using Stallion 7.0.1. I tried to use the template Static Page Blank Sales no Sidebars on a new page, but it’s not working. I select it, but then when try to go to that page it does not find it…
I wonder how could I fix it?
I thought upgrading to 7.1.1, but I got the message:
“Updating this theme will lose any customizations you have made”
Any hints?
Thanks for your Help
Regards
Héctor
WordPress Sales Page Template
WordPress Static Page Templates and Theme Updates
Stallion Static Page Templates don’t ‘load’ in their own right, they are like any WordPress Static Page, but with a different template.
The Stallion Static Page Blank Sales no Sidebars is similar to this post, but the sidebar code is removed, so if you’ve actually loaded the Page it will have whatever content you added to it.
I’m guessing this is not understanding how WordPress and Stallion treats new Static Pages.
When you create a Static Page it won’t necessarily be linked from your site, all depends on how you setup WordPress/Stallion.
If you are running with WordPress and Stallion defaults the new Page will be linked on the top navigation menu.
If you’ve added a Custom Menu under Appearance >> Menus to the Primary Navigation area (the top navigation menu) or you’ve disabled that navigation area under Stallion Layouts Options page adding a new Static Page won’t automatically add a link to that new page. These are useful WordPress features, I use Static Pages for the Download and Thank You sales pages on this site customers see after paying for Stallion, I wouldn’t want them linked from sidebars etc… My top navigation menu is a custom menu, you’ll note it also links to other sites, not just pages on this site.
There’s also the Page widget under Appearance >> Widgets that when added to a widget area will load all Static Page links. If you want static Page links on a sidebar I’d build a custom menu, add the links to the menu and use the Custom Menu widget not the Page widget: Page widget adds all Pages, with custom menus you choose what to add, order etc….
If this is your first Static Page either build a custom menu and use it as the primary navigation menu or make sure you haven’t disabled the top navigation menu under the Stallion Layout options page.
I think you’ve misunderstood what “Updating this theme will lose any customizations you have made” means. This refers to editing template files and/or adding your own custom images directly within the /stallion-seo-theme/ folder using an FTP program. If you are running Stallion and have never edited a Stallion file (that’s going to be 99.9% of users) and haven’t used FTP to upload custom backgrounds etc… updating Stallion using the built in update is the way to go.
If you have made customizations take into account using the built in update deletes the /stallion-seo-theme/ folder and recreates it from the update files, which means any editing and images you’ve added will be gone (make sure you have a backup offline). If you do have customizations use FTP to update, download the Stallion zip file, extract and upload via FTP taking into account if you’ve edited Stallion template files to re add any customizations.
If you do have custom images etc… look into installing a Stallion Child Theme, there’s a free example one on the site (link on the home page). When you install a child theme you can put your custom images etc… within the child themes folder (if you use the Example child theme the folder is /stallion-child-example/) so when main Stallion updates none of your custom images will be deleted. for example if you have custom header images under
/stallion-seo-theme/headers/
Move them to
/stallion-child-example/headers/
And they won’t be deleted when Stallion updates.
This is how all WordPress themes work not just Stallion during an auto update. I guess that’s why WordPress added child theme support because it makes updates of customized themes a pain.
Updating Stallion won’t delete your current option settings like your AdSense publisher number. Depending on the update some options might change and need resetting, for example changed where the thumbnail options are located (moved them from one Stallion options page to another, now part of the colour options) and had to set them to off, so if you find your thumbnails turned off you know why :-). I think that was the Stallion 7.0 update.
Other than that only other issue I’ve noticed is widgets on some sites (about 10% of my sites) messing up. Added more widget areas (so hard to remember when a feature was added, think 7.1) that split the left and right sidebar widget areas so there’s small widgets at the top and bottom of the left and right sidebars and on some sites after an update the widgets have ‘moved’ (the widgets still exist, so nothing deleted) into the wrong widget area, basically had to move them back.
I found a ‘trick’ to make it quicker to fix, before updating have the Appearance >> Widgets page open in another window. After upgrading Stallion if you find the widgets have moved (view the home page) go to the widgets options page you have open and just drag any widget up or down a bit and drop it back where it started (so like you are going to move the widget, but don’t), this saves all the widgets where they should be.
David
WordPress Static Page Templates and Theme Updates
Broken WordPress Page Template
Hi David,
thanks for your useful (as always) response.
About the page… it’s weird, because I cannot see the page (FF tries to open it up, but it just shows blank). I even try to open it up from the dashboard. It only happens with this specific template. This is the link:
Uhmm, I think I understand wp pages well. I suspect it’s something else. I see the page in the submenus (top right corner), but as mentioned before even trying from the dashboard does not seem to work. It works well when I change page’s template to anything different from “Static Page Blank Sales no Sidebars”.
I left it active so you can check it out and see what I mean.
Thanks a lot
Héctor
Broken WordPress Page Template
WordPress Theme Page Template Bug Fix
Found the problem, when I was updating code in Stallion 7.0.1 ran a search and replace that added mistakes to a few of the page templates which I missed, I fixed them in Stallion 7.1.
Easiest solution is update to the latest version of Stallion as there’s about 10 changes to that file to fix it. It definitely works in Stallion 7.1+
This gives an idea of how few of the features I add to Stallion get used, suggests no one used that page template in Stallion 7.0.1 as yours is the first error report :-(
David
WordPress Theme Page Template Bug Fix
WordPress Visual Composer
Hi David,
Thanks. I upgraded to 7.1.1 and now the template works fine. There is a minor thing… The text is showed in a single big chunk of text (a single paragraph). I tried adding extra lines to create paragraphs of 3 lines, but having no luck.
Finally, I entered and in html, and I was able to format my page properly, however, if I go back and switch to Visual composer instead of HTML it loses all the HTML formatting I had entered previously.
I think I’ve seen this before and does not seem to be a template issue, but I’m not sure.
Thanks
WordPress Visual Composer
WordPress Sales Page Template HTML
David,
Maybe it’s too much to ask, but a question does not hurt :D
I wonder if it’s possible to modify the “Static Page Blank Sales no Sidebars” template page in such a way that it also removes the blog name and blog description? so it looks more like a regular HTML-created sales page.
Thanks
Héctor
How to Create a WordPress Page Template
Doh, when I fixed the code error I mentioned above accidentally reactivated one of the Stallion header areas that should be disabled.
I’ll be changing that particular Stallion Page Template in the next update. It’s really easy to fix, simple case of adding a 0.
Opportunity to explain Page Templates :-)
Stallion Static Page Blank Sales no Sidebars is the file page-sales.php and is based on the page.php file (a WordPress template file for Static Pages).
This Page template has a lot more of the Stallion code directly within it because it doesn’t use as much of the Stallion themes styling for the main content (hence your earlier formatting problem) and shouldn’t have the Stallion header (my mistake fixing a mistake), it’s designed this way so you can build your content outside WordPress/Stallion, but not completely outside.
Most WordPress themes including Stallion use WordPress template files like header.php, footer.php, sidebar.php… these hold the header code, footer code, sidebar code etc… and are ‘loaded’ in a template file like single.php (template file for Blog Posts), page.php (template file for Static Pages) with this code:
Because I wanted full control over the page-sales.php Page Template I didn’t use the normal structure, instead copied the code from header.php, footer.php etc… and copied it directly into page-sales.php where you’d normally find
This means this file includes the header, footer, sidebar code in one file and can be changed outside of what other Stallion template files do.
If you load page-sales.php in a text editor you will see near the top all the header.php file code.
To fix my mistake find
Change to
This has the same effect as turning the header area off on the Stallion Layout Options page.
The really useful feature of this Stallion Page Template is I didn’t delete the code I didn’t want to load, I changed the options so they would never load which means it can be easily turned back on by removing a 0.
st_header_hide()==’1′ refers to one of the Stallion options (Stallion Layout : Show Original Stallion Header Area). When the Show Original Stallion Header Area option is ticked st_header_hide option is set to 1 and the code after “if(st_header_hide()==’1′){” is loaded. When the Hide Original Stallion Header Area option is ticked st_header_hide option is set to 0 and the code isn’t loaded.
This is why I set st_header_hide()==’10’, it’s checking (does it equal ==) if the st_header_hide option is set to 10, 10 is never set (only options for this setting is 1 or 0, on or off) and so the header code will never load (can only load when set to 1).
This allows Stallion themes users the option to turn features back on by changing a 00, 10 or a 20 (some options have more than 0 and 1 as options) to a 0, 1 or 2 (basically just added a 0 after features that are disabled).
For example if you wanted the social media links, Twitter, Facebook like etc… there’s two bits of code
The first line is when the links are added above the content, the second below. Changing them from 10 and 20 to 1 and 2 re-enables the links.
If you wanted both a Page Template with and without the social media links you can make a new Stallion Page Template.
Make a copy of page-sales.php and call it something like page-sales-plus-social.php (doesn’t matter too much what the ***** of page-*****.php is as long as it’s unique and starts page-
Edit page-sales-plus-social.php and change the st_social_network code from 10 and 20 to 1 and 2. At the top of the file is the name of template, currently:
Change to
Save and upload to your /stallion-seo-theme/ folder or your /stallion-child-example/ folder if you are using a Child theme. Edit the page you want to use the new Page Template on and it will be available.
There’s a file page-example.php which is a copy of page.php ready for Stallion template creation for templates that do use all Stallion features.
This template does use
So is for editing the main content, if you wanted more control you could replace the above with the entire contents of header.php, repeat with the sidebar and footer code.
Unlike other WordPress Themes you can use the Static Page templates on Blog Posts as well by activating “Stallion Layout Options : Custom Templates ON”. This setting also activates templates for Categories as well, the Category template files are categories-*****.php file format, same concept as Page Templates with an additional options page under Appearance >> Category Templates. When set the Page Templates are available for Blog Posts, some like the sitemaps are not suitable for blog Posts and shouldn’t be used for Posts.
David
How to Create a WordPress Page Template
Working WordPress Sales Page Template
Thanks a lot David.
I edited it the file and now the sales page shows up as I wanted it.
Thanks/Héctor
WordPress Static Sales Page Template
Hello David,
When I use the WordPress template static sale page, it does not appear the header image.
but others seem normal. what is the problem?
Thank you,
Ratanak
WordPress Page Templates
The WordPress Static Page Blank Sales No Sidebars page template is a stand alone WP template, basically all the code is within one file rather than loading the header.php file etc…
The file is
page-sales.php
That template is designed so you can add almost full page HTML code, for example the sort of code you get for promoting Clickbank affiliate products.
Basically you have to design your own head code otherwise it’s just content. What you are seeing is normal, if that wasn’t what you wanted either use another template or design your own.
David
WordPress Page Templates
How to Make WordPress Page Templates?
Could you guide me how to design head code? and where can I place those code?
I really don’t know how to do it.
Thank you
Creating HTML Code for WordPress
It’s HTML code, so if you wanted an image at the top create some image code, loads of HTML tutorials online.
You would paste the HTML code into the post edit form, like any content, like what you’ve done for the Amazon stuff, so more of what you’ve been doing.
David
Adding HTML to WordPress Posts
I don’t think that it would appear at the Head part of that page. It would appear inside the post content as I think. Because there is no option to let me paste that code for the header, that’s why I asked you. Or you can just write me that code for making sure.
Oh, I want to change the font color/size of post/page title to be smaller but I dont know where to go….
Please guide me,
Thank you so much
Adding HTML to WordPress Posts
Editing WordPress Theme Template Files
Try adding some HTML before assuming it wouldn’t work. Your other option is edit the template file.
There’s over 1,000 comments on this site and fonts has been covered many times, easiest way to find something is use Google do a search like this:
site:https://stallion-theme.co.uk/ change font
This will search this domain for the words “change Font” second result is discussing editing the CSS files.
Also discussed editing Page templates many times, loads of code examples etc… So some research and you’ll be able to help yourself.
David
Editing WordPress Theme Template Files
WordPress Template Editing
Hi, David !
When I tried to find the file .css, I could not find it. I checked in Appeareance => Editor in the admin panel. I just saw the php file only.
Also I log in to the FTP zilla, I can find the caroline.css but I could edit it.
What is the matter?
Thank you
WordPress Child Themes
You have to edit offline (on your computer) and upload using FTP, the WordPress editor doesn’t show CSS files outside the main them folder (only shows CSS files in /stallion-seo-theme/ and the Stallion colour scheme files are in a deeper folder /stallion-seo-theme/colors/.
Make sure you are editing the css file from the colour scheme you are using, if Delicate it’s style-delicate.css for example.
I would suggest learning how to use a Stallion Child Theme, there’s a free one Stallion Child Theme.
Will make future upgrades far less hassle, I’m running a Stallion Child Theme on almost all my sites now.
David
WordPress Child Themes
WordPress Tables Page Template?
Hi,
David, is it possible to create a WordPress page with tables and cells in Stallion?
which page template should be the best to do it?
Could you please give me some hints?
I found out how to create the table. I’m having some challenge…
how could I “force” for only a specific WordPress page and not sitewide?
that the hyperlinks are created without underline?
Thanks
Héctor
WordPress Tables Page Template?
CSS Underlined Links
@Héctor,
you need some basic css knowledge or someone you trust to do the required css styling.
It is very simple – there are basically two ways to achieve your goal. Let me know if you want my assistance.
Cheers,
delta
Override WordPress CSS Styles
You could override CSS styles in a number of ways.
An easy one is add this near the top of the WordPress Page template you created.
I’m assuming you made a brand new WordPress Page template or used a Page template you aren’t using for anything else. If not you make a new Page template by copying one of the files starting page-*.php like page-example.php (that’s there for making new templates based on the original Page.php format in stallion) and renamed it something like page-tables.php and edited the top line of the file (Template Name: Example Default) to change the template name (Template Name: Tables) so you can select it when creating Posts and Pages.
If you used the Example Page Template file as your starting point add it below the line
That should do it.
You could also add the new CSS rules as a Text Widget and use the “Stallion Layout options >> Widget Display ON” which adds new options to your Widgets: Stallion feature.
With Widget Display ON you have the option to show and hide specific widgets on single Posts/Pages/Categories etc… All you’d do is add a new text widget with the CSS code, and set that widget to only show on the Posts/Pages you want it on. It’s a quick way to override CSS formatting on a page by page basis.
There’s other ways to achieve this, those are the easiest.
David
Override WordPress CSS Styles
Adding CSS to a WordPress Text Widget
WOW
using the text widget CSS option worked perfectly!
yet, another great little known feature of Stallion
Thanks again
Héctor
WordPress Site Index of all Posts
Hi David,
I want to create a page with indexing.
I used short code for [Archive] in my new page visual editor, but it is not working.
So please let me know the probable solution for this.
Thanks!
WordPress Theme Sitemap Page Templates
Don’t understand your question? There are no built in short codes with Stallion, if you had them in a previous theme/plugin they won’t be available in Stallion directly.
If it’s a sitemap there’s built in sitemap Page templates.
Under Dashboard: Page >> Add New
On the right you can select various Page templates including sitemaps.
David
How to Make a WordPress HTML Sitemap?
Hi David,
1) Want to create page called “XYZ Index” that’s a HTML sitemap of all posts
2) This page contains only list of all Titles of my posts with each title hyperlink to its blog post
3) when I click on these hyperlink, need to travel to post page.
4) these lists of posts either can be taken from archive or category field.
5) My page should look just look like below:
> post 1
> post 2
> post 3
> post 4
How to Make a WordPress HTML Sitemap?
WordPress Sitemap Page Template
Closest to what you want are the Stallion Sitemap Page Templates.
There’s several that give different output
One has the latest comments linked at the top and the posts at the bottom.
There’s a template that only shows the posts.
Example output : https://stallion-theme.co.uk/stallion-responsive-sitemap/
David