PHP & HTML Fragments

Hi, new to the forum and relatively new to web design. I need to add a category to a specific page on our companies website. I have been given access to wordpress as well as the ftp server. All that I can find are PHP files, and after doing a little research I found that the php files are/can be compiled with fragments of html code (which is what I see when I “inspect element” within a web browser). I can see what I need to edit within the html code when I “inspect element” but I cannot find it within any of the php files that I have opened using “EditPlus 3”.

When I click “all pages” within wordpress and then select the page that I want to edit, there is noting within the visual or text windows. The permalink points to a page_id number that I am not able to find on the FTP server. Whatever organization we pay to make changes to our website has not been able to figure this out, which is why I’m trying. Any help would be greatly appreciated.

Welcome to Sitepoint!

There are many mechanisms in place which determine the result of a request to a given URI.

  • In a ‘classic’ HTML website, the URI relates directly to a path on the server. E.g.:
products/view/535.html
  • With ‘basic’ PHP websites, you can get ‘arguments’ to certain URIs, e.g.
viewProduct.php?id=535

. These are all managed by the code in viewProduct.php, and may display slightly different content depending on the ID.

  • Add URI rerouting on top of that (e.g. .htaccess files, for Apache-based servers), and one can map any URI to any server command, e.g.
products/view/535

could be ‘relocated’ (in a fashion) to the request

viewProduct.php?id=535

.

  • Many websites mix the above two around somewhat, so that ANY request is mapped to a single PHP file, and the PHP file dictates what to do.

As you can probably tell, there is a lot to swallow before you’ll be able to play around with a fairly complex website, such as one using wordpress.

However, wordpress does not command that you go through files to be able to change something like a category - that should be an option in the administration panel.

I should probably note that, if you’re a little more specific with your exact objective, the folks over at the Sitepoint wordpress forum will help you out.

By ‘category’, it depends on whether you mean a ‘post’ category or something unrelated to wordpress, like a simple link. In the former case, the admin panel should be able to handle your every need. If the latter, it’s a case of editing a template file.

Off Topic:

Oh, and you should probably fire that 3rd-party organisation if they can’t help you with this; It’s what you’re paying them for, right?

Yep, I was afraid that this may be more than I can take on. Forgive me for being dumb, but I am not seeing an admin panel in wordpress and I’m certain that my username is set up as an administrator, am I missing something?

When you go to your wordpress site, look for a Log In link, once you Log In. Once logged in, it should either 1) redirect you to the WordPress dashboard where you can alter categories, pages, posts, etc. or 2) take you back to the site because you don’t have permission to access the dashboard.

Perhaps I’m using the wrong terminology. Below is a cropped image from our site, the text circle in red is what I am calling categories. I need to add another one called “Principals”. I do have access to the wordpress dashboard, and yes we are paying this third party provider, they have been saying for weeks that they need to speak with the person who designed the site originally.

Hey @TripF ; normally this isn’t recommended (as we usually remove these things), but could you (if you are willing and able) provide us with the URL? I’m certain we can help you, but there are just things I’d really have to see with my own eyes to guide you in the right direction. I’ll definitely explain everything I do, so you could go through the process yourself. I really think we need to see it to help you get what you need quickly (otherwise, we’d be guessing – a lot)

Okay, in respect to TripF, I won’t share the URL, but I’ll share key components that I uncovered so others have an equal chance at participating in helping resolve the scenario.

Before proceeding, I highly recommend you backup your wordpress data before making changes to ensure if things get messed up, you can restore it!
Dashboard > Tools > Export > All Content

The URL contains page_id=X, so we know it is a Page in WordPress (look in the Pages area in the Dashboard).
Find the page and click Edit
There are a few things to check for at this point

  1. You may see a LOT of content and tags in the big WYSIWYG editor window
  2. You may see nothing in the WYSIWYG editor window

If you see a lot of text, look for the words PARTNERS to see if that is part of the content (if it isn’t continue with the “if you see nothing”).
If you find that text, alter it accordingly to add whatever content you need.

If you see nothing, look at the Page Attributes on the right, and look to see what Template is being used (write it down).
Now navigate to Appearance > Editor
On right, find the template that is similar to the name you wrote down and click on it.
Look for the word PARTNERS and edit it accordingly.

Wow, thanks a ton! There was nothing in the WYSIWYG editor window, I had to navigate to the template. I’m sure this will take some trial and error to get it to look right, but this is exactly what I was looking for all day yesterday. I have turned to forums for help before (from cars to golf clubs) but never have I received such valuable information in such little time. I really appreciate the help, thanks again!

Not a problem. If you get stuck, please tell us, I’m sure we can help you get to the result you need :slight_smile: