Wordpress Preview shows wrong Template - php

Recently, when I view a page in Wordpress Preview mode, it always loads the default template (theme page.php file) whereas when I look at the published page, it's the right template. I have around 10 different templates for my pages. Just keep in mind that I'm not talking about the theme itself, but the Wordpress template structure. I included three pictures. The admin panel one, shows different templates for my page.As shown, I chose Fixed-Width Clean Page. The second picture shows the page in Preview mode.As you can see it includes a sidebar which is included in the default template but not the one that I chose. And the last picture is the Live view of the website which is correct. As you can see the sidebar doesn't exist. I searched all over the internet and did some suggestions, but none of them work (like saving the permalinks again, changing the theme and changing it back again, etc). The only change that I recently made was upgrading to Wordpress 4.7.4 and blocking access to admin panel by ip using .htaccess file (I removed the .htaccess file, but still no luck). Any suggestions would be appreciated.

OK, after some time I figured out what the problem was. The "WP Subtitle" plugin version 2.9, breaks the preview functionality if you have multiple templates. I report the issue to them as well, but posted the answer if somebody came across the same problem. In order to fix the issue temporarily, i commented out the below line (line 74) on the plugin's main file (wp-subtitle.php):
//add_filter( 'the_preview', array( 'WPSubtitle', 'the_preview' ), 10, 2 );

Related

Wordpress Year archive not working

I have a strange issue that is driving me crazy, I am hoping someone might be able to point me in the right direction.
This started happening recently, but I can't put my finger on exactly when.
This is my post archive page: http://test.aclighting.com/news/ and it's using home.php. This looks ok until you click on a year archive link: http://test.aclighting.com/news/2010/, it should be using date.php.
The news doesn't change, its the same list as before. If I put the year in the querystring it does work: http://test.aclighting.com/news/?year=2010 but is still using home.php.
Oddly though, monthly archives do work: http://test.aclighting.com/news/2010/10/ and use the date.php template file.
I have tried with all plugins turned off, and have tried using Twenty Twelve theme, it doesn't make any difference. I have tried saving my permalink settings too.
The site is set to use a static front page, a page called Home as the home page, and a page called News for the news posts page.
Since this doesn't appear to be a theme issue or plugin issue I can only assume its a setting issue, but can't see what it is. Any suggestions?
Cheers,
Steve

Editing a Drupal footer

I'm now maintaining a Drupal site that was built by someone else. I'm a total Drupal newb but have some coding experience. The site was last updated in 2011 and I have spent much of this evening, with some success, trying to edit the footer where it says "last update 2011" to "2014". I found a post here which directed me to some tpl.php files in the site's theme folder. There I found the hard-coded "2011" string in several different places (3 different files) and updated it.
Now on the website the new date string appears on every page except on the home page when I am not logged in as a user. That is, when I log in to edit the site in the normal way, then the home page displays my new "2014" string. When I log out and view the home page anonymously, then we're back to "2011". All other pages are good.
Can someone suggest a solution to this? Thanks in advance,
David
You can use "Footer Message" module for Drupal 7. Try it, I hope it will help: https://drupal.org/project/footer_message
It's said that "A configurable footer message, editable from the site-information form and displayed as a block, as well as a theme variable available in page.tpl.php and hook_preprocess_page()."
In Drupal 6 it should be a block responsible for footer. Also if you are logged in as administrator see this menu : Site Configuration > Site Information > Footer Message. You should be able to edit footer from there.
It does depend on how the site was built so a few things to look at:
a) Blocks. Have you got different block configured for different users/pages? Generally this is best practice as it is easy updated in the CMS.
b) Theme template files. You said you found this hardcoded in a few places but have you checked the all templates in all the themes? Bad practice anyway.
c) Modules. Is there a specific footer module in use?
d) Theme settings. Unlikely but possible there could be a config string in the theme.info

Standard HTML & CSS to wordpress page

I created a webpage in Standard HTML and CSS and everything looks / works exactly how I want it too.
Now I need it to appear as it is on a wordpress site (http://www.texasenergyessentials.com/). I already created a template page and can see it in the template select in the wordpress "add new page" window. I was hoping I could just select the template and leave the text editor blank but that doesn't seem to be the case. All I get is a completely un-formatted page that says welcome guest.
What is the easiest way to get https://gist.github.com/anonymous/8545681 to work on the aforementioned wordpress site? ?
Thanks!
P.S. Please don't link any codex files I just spent 2 hours digging around in them :(
Try to read and understand how http://codex.wordpress.org/The_Loop works
Install this theme https://code.google.com/p/wordpress-naked/ and try to work your way to the desired theme by editing theme files. That will be much easier.
Maybe the problem can be understood by reading the template hierarchy:
http://codex.wordpress.org/Template_Hierarchy
(especially check the visual overview)
If you name your file page-[insert-page-id-here].php Wordpress will use it for the page you've created. Get your page id by editing the page and looking it up in the url.

Wordpress page not showing with correct template

I have created a new page and allocated to default template which is same as other pages but it shows up with broken template with comment (which I want to remove from this page) in it and I cannot find where it's coming from i the actual template folder. I have searched page.php and others but had no luck.
The settings are exactly the same as other pages and I have no idea why it's doing this.
Is there somewhere I can check to resolve this issue?
If you need to disable comments, you can do that within the page editor in the backend. It should be below the content area.
Regarding setting a page template, If multiple page templates are available for you to use, you choose which page template each page uses on the right side of the page editor underneath the Publishing options.

Comments are not displaying in wordpress 3.1

Im running Wordpress 3.1 and its showing that there are comments (ie: 3 comments) but when you click into the single blog post they don't appear but the comment form appears.
Im not sure whether its a template issue or something's not correct in the functions.php.
I have the multi site function running for multiple blogs.
Anyone else having this problem and or have a solution?
It has to be template issue, make sure that you have comments.php file present in your theme directory. You may want to copy from default theme too. The functions.php has nothing to do with that though.

Categories