You can see on this page: http://oaktreehealth.ca/community/
That the PHP is not rendering out for some reason. I have the same function enabled on most other pages where you see the image in the background at the top of the page.
I'm not sure why all of a sudden it stopped rendering on this page? It was working fine, maybe a wordpress update?. I'm using wooththemes Canvas with a child theme. The only difference with this page is that it is a modified template of the blog template.
The area causing trouble is called in my functions to grab the template part. All other pages do this fine except this one. Any idea?
I'm not entirely sure how to add code in here, but i'm happy to send anything along to help.
The page you've linked, seems to have encoding issues, i believe due to white spaces before the php tag, if you inspect the source, you can see:
��<?php
Check the script corresponding to the following comment (as per the source):
/**
* Template part for Media Feature Area
*/
And try to remove all whitespaces at the beginning and end of the script.
Related
So i have Wp rocket on my site and i saw that every time i modify a image or a text from my site, the homepage appears white with only the cookie icon visible.... i have to delete cache each time this happens and also i have to check page every time.. This i what support said but no clue.....
I enabled WP Debug while performing the following test:
I made a small edit (added a dot at the beginning of the content) and saved the settings. I visited the page from desktop and from mobile, but it rendered correctly. I repeated the test by reverting the change I made. Still, the page got rendered correctly.
So far I could not reproduce the issue, but I checked the information provided by Sandy. Based on my observations, the issue is not related to WP Rocket, but I will explain to you why you see it when WP Rocket is enabled.
Generally, when a page is rendered in WordPress your theme is rendering the following parts of the code in the exact order for each page:
header.php
template (i.e. the content)
footer.php
When the issue occurs, the template part is missing. Here is how I found it:
Sandy was able to reproduce the issue in the past and shared the code difference between the blank page and the correctly displayed page. You can find it here: https://www.diffchecker.com/AKBv9sVj/
Here is the place where part of the HTML is missing on the "blank" page. And I highlighted the last line of code that is included in both cache files:
Full-screen image: https://i.imgur.com/28DgxpT.png
That last line of code comes from header-adora-framework.php which is included with no issues:
Similarly, the next segment that both pages have in common comes from the footer:
Full-screen image: https://i.imgur.com/wsw4wHk.png
This is where the code in footer-adora-framework.php, and it is also included with no issues:
Full-screen image: https://i.imgur.com/9Nw0QDv.png
Based on this, I can see that the template part is missing. It seems your theme is not rendering the template sometimes.
I checked the debug.log that is available on the server and found the following fatal error that might be related to the issue:
Here is the main part of the error: "The template "/wp-content/themes/project-theme/templates/layout.html.php" cannot be rendered."
If you check the file mentioned in the error, you will find that this is exactly the part that is missing:
Full-screen image: https://i.imgur.com/SpLKbyH.png
The code from /wp-content/themes/project-theme/templates/layout.html.php:
Full-screen image: https://i.imgur.com/7KfMxCR.png
The reason that you see the issue only when WP Rocket is enabled is due to caching. WP Rocket "takes a snapshot" of the page the way it was rendered the first time it was accessed.
If the template did not render the template part when the page was accessed - this is how the page will be cached and you will see the issue persists.
This, however, does not mean that the issue is resolved when you disable WP Rocket.
The issue is happening, but it is not persistent as with caching. Refreshing the page when caching is not present would likely resolve the problem.
You would need to pass this information on to your theme support. Possibly they will have suggestions on how the problem can be resolved.
I try all but nonthing. I hope to fix this with your help
I'm asking for help for those who have experience in changing an html file to a php file. I've tried everything I know (and I'm not the smartest I admit) but I don't understand why the following is happening.
Currently: When viewing on mobile, the mobile menu button has gone, the toggle switch which changed prices from monthly to annually, tabs which displayed different content has gone. As a result:
If there was a toggle, both the toggle results are displayed one above the other
If there was a tab, each tab element is displayed underneath the other
The mobile menu button has gone completely
Background:
I purchased an HTML template but it turns out the seller didn't want to help. I wanted to split and convert the page into a php page as I wanted a single header/footer file which I could import. As you will see (if you check the repo) the header.php and footer.php file is getting imported into the page php file.
I created the pages by first:
Renaming the original html file to a php file
Cut the header and footer and import them back into the page php file
That's all I have done. It seemed to work, however another check (after cache cleared) I noticed the issues.
The link to the site page im referring to is:
https://blueboxhosting.co.uk/products-cloud-hosting
But if you look at any of the pages, you'll see errors on all of them now where they're should have been controls (eg toggles, mobile menu, tabs etc)
I've created a snipped so you can view the code and HOPEFULLY spot where I've been a moron:
https://bitbucket.org/snippets/bbhostinguk/7e5qxp
Any help with this would be amazing as I just can't figure it out.
Start by running the HTML generated by PHP through a validator, e.g. https://validator.w3.org/
Your code has numerous stray tags which may or may not affect the rendering.
Another tip is to comment off everything and then uncomment section by section and check when things start to break.
I've used a modified themeforest template for a single php page and have an issue where the navigation links that take you to the various unique id's on the page are working fine but cut off the top part of the section h3 that it has linked to.
It's a positioning problem for sure and most likely to do with the modifications I made to the flex-slider that the template included.
But I can't determine how to adjust the css (or script) to correct the issue.
For example, the site is http://goudkamp.stacklaw.com.au/ and when you click Services, you can see what I mean.
I have the template on the site as well so you can see how it SHOULD work - http://goudkamp.stacklaw.com.au/v2/template/.
I came across another article that suggested using the script
if(window.location.hash.length){
$(window).scrollTop($(window).scrollTop() - 100);
}
However, I don't think I should need it when the template works perfectly.
I just don't know where to start looking to make the necessary adjustments.
Please help!
Thanks in advance
Wait - I found it!
After looking at the suggestion on the other article, it made me think that it must be done in the theme's custom scripts. So I looked in the custom.js file for any script that referenced the main nav.
There was an "offset" line with the markup "//use this to position the window exactly where you want". Testing a small change to this had the desired effect.
Thanks anyway.
I am having a bit a frustrating time with the following code and was wondering if anyone can help me out.
I have the follow text in an article in Joomla and am getting strange results.
I'm using Jumi to call some php code, and in the desktop view the called code works.
However when in the mobile code section, it seems that mobilejoomla is preventing jumi from executing.
This seems rather weird. Has anyone seen a work-around? Am I missing something?
{jumi [functions.php]}
{desktop}
This JUMI output text shows
{jumi [index.php]}
This writing shows
{/desktop}
{mobile}
This JUMI output text shows
{jumi [mobile_index.php]}
This writing does NOT show
{/mobile}
Basically, I don't want the same content on the mobile view page, to the desktop page.
I am sure my code works, because when I do the following, I still get nothing in the {Mobile} view.
{jumi [functions.php]}
{desktop}
Show some text
{/desktop}
{mobile}
This JUMI output text shows
{jumi [index.php]}
This writing does NOT show
{/mobile}
Different content types doco.
http://www.mobilejoomla.com/documentation/14-extensions/110-mobile-content-extension.html
Thanks in advance.
Steve
I depend on jumi for lots of small scripts and was having a similar problem. I wanted to add a popup window of an image using sigplus or modals within a script. The plugin wouldn't parse within the jumi call. It would just print the braces and code. I tried a bunch of workarounds (hardcoding the script itself & divs, tables in the joomla content). I finally tried sourcerer for incorporating this script and the embedded code worked.
{jumi [myscript.php} with a hardcoded call within the script itself -- to {modal linktoimage/image.gif}image{/modal}
doesn't parse the plugin. Runs the script, but just prints "{braces and whatever is inside}"
With sourcerer
{source} <? my whole script here including {modal linktoimage/image.gif}clik me{/modal}{/source}?>
Works fine. With Sourcerer I had to get used to writing or pasting my script within the joomla content editor instead of calling it from a dir/script. If I'm way off target remember I am just trying to help.
I am new to SMF.
I just installed SMF on my website. I tried editing the index.template.php . After saving changes, it displays raw HTML and PHP on the browser. I tried fixing the prob by returning the the page back to the original state to no avail.
At the moment, everything is gibberish both frontend and backend.
Pls what do i do?
There should be at least an open tag at the top of the file (at the top of every .php file). Make sure you didn't remove this tag. Everything outside of a <?php is interpreted as normal text so if you have removed this it would explain your issue.
Also, being an ex-team member for SMF I can assure you its better to create a copy of the default theme, then make your edits to that theme. Then if you experience an error you can always pass a param in the url to reset to the default theme (in case you need to get into the admin area). To do so end the url with index.php?theme=1