• hi all,

    I’m just trying to access the html of my WordPress to change an href. A quick no or a yes with marginal explanation would be a huge help. thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Generally No, WordPress generates HTML dynamically depending on what Theme and plugins are installed. so to change a href the theme or plugin would need to have a setting to accommodate what your trying to do.

    Of course it is possible to modify anything in WordPress, if you explain what your trying to do i can give a slightly better (but still quick) explanation.

    Thread Starter carriemf

    (@carriemf)

    Essentially, I have wordpress set up on an independent subdomain. Whenever I click my wordpress’s title, I want the user to return to the main site. If I had the html (I’ve been playing around with inspector), it would be as simple as changing an href

    Ah i see,

    First i would ask what theme are you using? and then i might be able to tell you if/how to do that in a settings panel.

    I’ll explain how you ‘might’ go about doing that another way so you can consider your options.

    first its important to know that when you look at the HTML of WordPress in Inspector, you are looking at a ‘compiled’ version of WordPress, and to actually access the HTML code you must understand that the HTML code is split up into seperate files, for example, the <title> </title> tags for a WordPress site are almost always found in the header.php file inside the themes folder.

    edited: Generally there are not .html files used with WordPress, instead all HTML code is placed inside .php files, and these .php files are loaded depending on which links you click. a .php file will contain HTML and that HTML will be rendered based on certain conditions which are set by the PHP code that resides inside the .php files along side the HTML code.

    Go into your website root directory or the directory linked to the subdomain where WordPress is installed and find the wp-contents folder. Go into wp-contents and you will see a folder called themes, go into this folder and you will see more folders, these folders will be labelled as the theme names that you can preview and activate from within the WordPress dashboard Appearance > Themes.

    I recommend making a backup of any theme you wish to modify and consider making a child theme – see below. The first file i recommend you to have a look at is index.php and then single.php, these are the two main files that make your website work, and you will find HTML code in there.

    Finding the href to the main site will probably be in header.php.

    Check out these resources to get a better explanation:

    Moderator bcworkz

    (@bcworkz)

    Excuse me while I butt in in the interest of getting you an answer sooner. The answer is theme dependent, but you can likely use the ‘home_url’ filter to alter the title’s href. Check your theme’s header.php template to confirm the href is coming from a call to home_url() or get_home_url(). If so, the ‘home_url’ filter will work for you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can you still access html in 4.1’ is closed to new replies.