I'm editing a Drupal that was created by a company who didn't follow Drupal best practices with the idea that only them can edit the theme. I'm having some problems with the footer and I would like to know where is the file that contains the footer html code, because in the theme I have donwloaded (Boostrap Drupal7) it shows a footer rendered by <?php print render($page['footer']); ?>
The problem I have is that the footer has a block and I don't want it, but in appearance the block is not assigned to the footer, and I had tried to remove it.
Where is the code called by this function?
First, login as admin and make sure what theme is been used, check that, here (see what is the default theme)
/admin/appearance/
Once you know what is the default theme, go to the directory and find the following template: page.tpl.php
/sites/all/themes/theme_name/templates/page.tpl.php
Find the code:
But, remember that you can find searching any string using any IDE like phpstorm or sublime. It's very simple using it.
Well, some of Brute-force approaches:
Do a grep of footer content in your theme folder. (sites/all/themes/xyz)
OR
Do a grep of footer content in your module(sites/all/modules) directory. In case, the developer has put custom module or put custom code in some module.
OR
Do a grep in your drupal root folder except sites folder.
OR
If you are able to find in which region your footer is being shown, Look in every block in that region (under admin/structure/block). Click on edit of every block in that region. See, if you are able to find the footer content.
OR
You can see each view (admin/structure/views)
Related
Creating web-site on WordPress, and got problem with finding HTML code of current part.
Web site here
Need to change Services titles and descriptions, but can find this part of code on FTP server. Is it possible to find it? Here the structure of ftp
i supose it must be in index.php, or index-servise.php, i was cheking this files(and all other) there is only functional part of this blocks. Can anybody help me to find this HTML code?
The <head> tag of your page is located in the header.php file of the current theme you are using. Your theme files are located inside the /wp-content/themes/. You can edit there. To see which theme you are using, access your WP-ADMIN and navigate to Appearence > Themes.
The Services seem to be generated as Widgets, so you should find them in Appearence > Widgets. These are stored in the MySQL database and are not hardcoded in HTML.
I'm working on a Wordpress website for someone and I have a question. I used an inspector (firebug) to check out the html of my site but I need to know where to find that bit of code in the Wordpress theme (Spacing) php files. There's no search all feature and going through all of them separately is ridiculous.
I really appreciate any help you can offer!!
I found an article on it (https://wordpress.org/support/topic/search-through-php-files) but there really wasn't a solution. If I can find what I'm looking for in the HTML (it's a menu name by the way), why can't I go find it in the theme files??
I don't know if this matters but the HTML is a body class to a couple of div classes to a ul id to li id to an a class.
WP does not contain ant HTML page. Everything in WordPress php file. If your page is created in page section you have to check in page.php file in /wp-content/themes/{your theme name}/page.php or if your page is posts you to check in post.php
What you want to change in WordPress site ?
If you go into the back-end/admin section and click "Pages". Find the page you are working on and click edit. In the "Page Attributes" you can see what "Template" it is using.
Then you can find that template in /wp-content/themes/yourtheme/
EDIT: More than likely the header and navigation is located in the "header.php" file in the themes folder.
I am fairly new to WP and very new to Roots (http://roots.io/) and I am having trouble creating a custom home page. Here's how far (I think) I understand it:
To create a custom home page I put a file named "front-page.php" in the WP root directory. This file is based off of "page.php".
"front-page.php" loads "content-page.php" from the templates directory.
And that's where it gets a bit fuzzy to me. The function "the_content()" lives in "content-page.php" and I'm assuming it loads the content of the page but it's loading some default stuff (I think it's added by the Roots theme) that I don't want there. I don't think the proper way to customize the home page content is to modify "content-page.php" and remove or change the function "the_content()". I'm assuming there is a better, modular way to do this, possibly creating a custom class that will be loaded when "the_content()" is called but I don't know where and how to do that.
As you're a bit vague with the details I'm going to have to read between the lines a bit. If you need further clarification just ask:
the_content() just outputs the content stored for a particular post, which you would edit in the WP admin. In terms of editing the markup that surrounds the content you have a couple of options. You could edit content-page.php as you require, or create a new partial (such as content-home.php and load that instead.
You can also use filters for modifying content; these are often used to change content that appears in multiple places such as 'read more' links. Check out this introduction to filters for more info.
In closing, you don't want/need to edit the_content()
I'm presuming I have to edit the footer through mysql, I haven't done this website, a colleague who has decided not to come back into work has put this together http://tandgwebdesign.co.uk/ashleafarmshop.co.uk/ and it's using the Journal 2 theme, however, usually I would edit the footer through the footer.tpl, or even in the admin panel, however I can't fathom a way of editing the "FREE DELIVERY ON ALL ORDERS OVER £80" and the few lines of text below.
Could anyone help me out and tell me how to edit this through MySQL? It's an OpenCart website, or is there any easier way to do it?
The footer is stored in a file called footer.tpl in the following folder:
catalog/view/theme/YOUR_THEME_NAME/template/common/footer.tpl
Check the footer's <h1> tag and see if you can edit the text there. If there's only a variable there, then I guess it stored in a language file (catalog/language/YOUR_LANGUAGE/common/footer.php).
I am working with Drupal 7.17.
I have a custom content type I created called Sidebar Ad (machine name sidebar_ad) that I want to add Javascript and PHP to. From what I understand, in the templates directory of the theme I am working with, I need to create a file called 'page--sidebar_ad.tpl.php' and I can put PHP and Javascript code in there, and it will only run in blocks and pages that contain the custom content type Sidebar Ad.
I am trying this out with one of the stock themes, Bartik, and it is not working for me. I tried it by copying the page.tpl.php file, renaming it page--sidebar_ad.tpl.php, and adding a bit of text in a few places - at the top of the php file, and in the content div. But I don't see anything change on the pages on my site that contain that custom content type.
Is there something I am missing?
Most likely the thing you're missing is flushing Drupal's cache...any time you add a hook or template file, you need to flush the cache so the various registries can pick it up.
In the case of an overridden page template file you also need a copy of the standard page.tpl.php file in your theme. Same goes for the node template and most likely others, you need the original in there for the overrides to work.