editing WordPress Theme with content embedded in PHP script - php

I am trying to redo my homepage of my website which is a WordPress website. The homepage is hardcoded in PHP, and I would like to figure out how to
Replace some of the image files
Edit the text under those image files
I have redesigned the (4) image files I want to update the site with, but I don't know where in the script to paste the name of those files. There are tones of file slike index.php, theme,php, and I would figure that under these I would see "front_forecast.png" somewhere where I could erase that and type in the image file name I want there instead, but I haven't had success.

It's going to be a bit hard to help you without seeing some code, your current site, or even knowing what your theme is. As gwillie said though, it might be best to go back to basics first.
From a template pov, I have always found this diagram helpful in understanding how WordPress uses its templates to output content (source: http://codex.wordpress.org/Template_Hierarchy#Visual_Overview):

Related

Should I add home page HTML in wp classic editor or front-page.php for speed?

The title basically says it. I currently have my home page with the HTML sitting in the classic editor box. Should I move that to front-page.php? I know that it doesn't REALLY matter, and it won't have a huge impact, but I am being meticulous about creating a speedy website. So which is faster?
Also, I am currently using 2 separate PHP files for headers. One on the home page, and one for the rest. Should I just hard code the header for the home page into the same place as the home page HTML since it's the only page that uses it?
I'm pretty new to PHP, but I've searched Google extensively and can't seem to find my answer. Using WordPress. Really appreciate your help!
For speeding up the website, no need to change the home page or the header file. please do the following things for speeding up the website
Optimise your images
Enable caching
Enable GZIP compression
Minify CSS, HTML & JS files
Update plugins
Clean-up your database
Moving the html code to a template file will improve the site speed because WordPress will not have to retrieve those html tags from the database. And it is conventional and actually a good practice to place all rendering code (html, css, js) to the template or theme files where they should be, instead of directly adding them in the backend or instead of including them directly in the post editor.

How to find function and HTML code in wordpress

Normal when i try to customise WP style i would use inspector view in Chrome and this would allow me to locate style code easily.
i was wondering how i can do the same for HTML or PHP code in WP such as plugins and the CMS it self?
Thank you
PHP is server side code and can't be found in the browser. If you want to see the code for WP plugins then you'll need to either download the plugin to your local machine or view the files on the server hosting WP.
Iassume you run it on your own root-/ webserver,...
so if you want to add HTML Elements to a post or site just do it in the text few like you would in an HTML-Editor like for some link thing for instance (you should allready know that..'pretty shure it also works for js).
However if you want to customize the way every page on your blog looks, you can also do this manually, but it won't be as easy.
There should be a section under the theme customization part where you could upload your own css and php (at least with a lot of styles it's like that).
I WOULD NOT mess with the files on your server, if you don't know what you are doin, cause - to be honest - you can make a great blog/ website by using the tools it gives to you. ;)
I recommend using the stylesheet from your wordpress theme for a custom HTML-document based on the source of a blog page, if you go for the looks... and in every other case just use plugins! :P

WYSIWYG way to work with xyz.tpl.php/CSS files?

I recently purchased a script that I'm trying to change the CSS to pimp it up :)
However since I'm fairly new to CSS/PHP (I've done ASP before), I'm trying to use the "Live view" feature Dreamweaver 5.5 to edit the tpl.php files. I have setup the site as instructed in DW and it's working with basic PHP files, however when I try to open a tpl.php file it doesnt seem to handle all the includes or something, so essentially it doesnt know how to retrieve all the related CSS etc in order to show me what the site looks like.
It has the following code structure:
www.xyz.com -> this calls the index.php
Within index.php, it calls include_once ('global_mainpage.php');
Within global_mainpage.php it then calls $template_output .= $template->process('mainpage.tpl.php');
mainpage.tpl.php is the file that I need to change the layouts/CSS class reference etc.
My ideal way to work with the site is:
Say if I want to change something on index.php
I just click on one of the elements in live view
It would automatically launch the tpl.php file being used
I can then examine the CSS used and make a change to it
hit save and be able to view the change I just made
If this is not possible, do I have no choice but to use Aptana? I've used it before editing PHP code, but not tpl.php - I was hoping to have a WYSIWYG editor for tpl.php...
Many thanks for your help gurus! :)
Why don't you use FireBug on Firefox and hook it up with cssUpdater?

TinyMCE image uploader and paths

I'm using the TinyMCE editor and imagemanager to edit pages here. For backup reasons i also have to store a copy of uploaded images in the database.
So after reading the TinyMCE doc i started editing the _Template.php file to biuld my own plugin, and it's stored in
$HOMEDIR\js\tiny_mce\plugins\imagemanager\plugins\CacheToDb\CacheToDb.php
my problem is that i want to access my common functions and classes in "my" $HOMEDIR/inc/ form within CacheToDb.php; however i have problems to point back to /inc/class_database.php from
$HOMEDIR\js\tiny_mce\plugins\imagemanager\plugins\CacheToDb\CacheToDb.php.
I tried to add the following lines on top of ChacheToDb.php
define('__ROOT__', "../../../../");
require_once(__ROOT__."inc/global.php");
require_once(__ROOT__."inc/class_database.php");
Going up 4 folders here because it's apparently included from
$HOMEDIR/js/tiny_mce/plugins/imagemanager/index.php
However, this dosnt work. Every time i try require_one() i always get an empty window when i click the "add image" button in TinyMCE, so i assume a php error message breaks the json response...? Firebug did not reveal any obvious bugs or usefull info at all.
Anyone who had this issue before and know how to include a path without breaking the whole thing?
You should have a closer look into the servers error log in order to check what the error is.

How to edit the files of an osCmax site

I have a website running on osCmax setup by a developer a while back and now I want to restyle some of the pages myself from the markup and CSS only.
I'm familiar with HTML/CSS and some jQuery to an extent but I have never touched any PHP. This is my first time really getting into any of the osCmax pages, site, etc., myself so I am little confused on what it really is or does.
If I want to edit any of the HTML/CSS myself for styling pages will I have to download and login to the osCmax admin panel to get to any of the files?
Or can I just go directly through my server to grab the appropriate HTML and CSS files? Wouldn't all the necessary files from the download be on my server already or is this something that I have to download to use?
If all you want to do is restyle the pages, then just modify the css. You shouldn't need to modify the PHP (unless parts of your HTML are created with out a class or id).
oscmax has a seperate folder for its template. all you have to do is editing the .css file. but sometimes you need to design the template from scrath and since the OSCMAX is outdated you must edit all the pages with .tmpl prefix.

Categories