How do I change my footer information? - php

I have a website that I am trying to edit, but only have it available on my localhost WAMP server, so I can not link to the site. The footer has wording that I would like to change, but my footer file only shows the following:
<?php PC_Hooks::pc_after_opening_footer_tag(); /* Framework hook wrapper */ ?>
<?php get_sidebar( 'footer' ); // Adds support for the four footer widget areas ?>
<?php PC_Hooks::pc_before_closing_footer_tag(); /* Framework hook wrapper */ ?>
</footer>
</div><!-- #body-container -->
<?php PC_Hooks::pc_after_closing_footer_tag(); /* Framework hook wrapper */ ?>
<?php wp_footer(); ?>
</body>
</html>
I do not know where to find the file that I need to change. I have litterally gone through every file and can not find where it determines what it shows in the footer. I am not completely familiar with PHP, but can generally figure out at least which file needs to be edited. Can anyone help me understand where I might be able to find the file to edit to change the wording in my footer??

Related

PHP - Hide Element Only On Home Page - WordPress Site

In my footer.php file, I have this bit of code towards the end of the file:
<?php wp_footer(); ?>
<div class="website-by">
<br>
Website by Gateway Web Design
</div>
</div>
</body>
As you can see, I've created a "website by" link, which links to another website when clicked on.
But I don't want this text, or the div that contains it, to appear at all on the home page of the site:
https://thehamburgercollection.com/
I've checked other stackoverflow articles that suggest doing so with JQuery, which I've added to my scripts.js file:
//hide link on the home page
document.ready(function() {
if (window.location.href.indexOf('https://thehamburgercollection.com/')) {
//Hide the element.
jQuery('.website-by').hide();
}
});
And I've also tried hiding the div on the home page with CSS that was suggested here:
.home .website-by {
display: none;
}
But unfortunately neither of these methods have worked. I've declared my class as website-by in the footer.php file, and have added the JQuery that should target that class in the scripts.js file, and have also added the suggested CSS. Any idea why either the JQuery or CSS code isn't working?
This is a WordPress website and a custom there. Any help / suggestions / education is appreciated!
I'm not a WordPress guru, but have you tried doing an if condition in the footer.php? if I got your question right, you need the .website-by to not appear elsewhere but the home page. Maybe something like
<?php wp_footer(); ?>
<?php if (!is_home()): ?>
<div class="website-by">
<br>
Website by Gateway Web Design
</div>
<?php endif; ?>
</div>
</body>

Nested php include files - Not showing content Wordpress

I have some php include files which are pulling through content to my main pages such as header.php
Within these php files I have other php includes which call different elements of the design.
It will displaying perfectly fine until I converted the flat HTML files into a Wordpress theme directory.
The main header.php file displays but any php includes within it do not. Please could someone help.
Here is an example of a php file header-withbooker.php
<?php include 'includes/content/headers/with-booker.php';?>
Within this file it then looks like:
<?php include 'includes/content/nav/top-nav.php';?>
<div class="container">
<div class="full-header">
<?php include 'includes/content/rating-box.php';?>
<h1>Your journey begins here</h1>
<h2>4-90 seater vehicles & drivers available worldwide</h2>
</div>
</div>
</header>
<!-- Close Header Box -->
<?php include 'includes/content/booking/main-booker.php';?>
Any idea what I am doing wrong?
Thank you in advance
You can include files in WordPress Like:
get_template_part( 'includes/content/headers/', 'withbooker' );
get_template_part( 'includes/content/nav/', 'top-nav' );
get_template_part( 'includes/content/booking/', 'main-booker' );
Hope this works for You.

How to Make or Call sidebar in CakePHP

I have such type of code in view, add.ctp file in Cake PHP.
<div id="container">
<div id="content">
------------------
</div>
<div id="sidebar">
----------------
</div>
</div>
Now in Layout, in default.ctp file, we access this code by this line.
<?php echo $this->fetch('content'); ?>
I have sidebar in each and every view file, and if I need some changes then I will go in each and every file and then change.
Now My Question is that, can I made a file in layout like sidebar.ctp or any thing else that I just call this file in my view. If I can, then how I will made such type of file.
You could do it with include or elements like this
<?php echo $this->element('sidebar'); ?>
With the element, you make the sidebar.ctp file in the View/Elements/ folder.
Check for more information: Cakephp 2 Elements
The other way is with include (not my choice, but another way to accomplish it)
<?php include('../View/Layouts/sidebar.ctp'); ?>
You can use elements and if the content in elements is dynamic you can use the blocks supported in latest version of cakephp.
http://book.cakephp.org/2.0/en/views.html

WordPress, disabling parts of Roots theme (like Bootstrap)

I'm working on a WordPress site. The Roots theme was installed by someone else. I want to code pages as directly as possible without using Bootstrap. I don't completely understand WordPress, but it looks to me like base.php is code that wraps every page. I'm wondering how much of this I can change without messing up the theme. Mainly I don't want to use Bootstrap. Can I just remove the references to the 'container' and 'row' classes? By the way, what are the 'wrap' and 'content' and 'main' classes? How do I find out what roots_main_class() is? Is there another way to do this, like not loading bootstrap.css?
<?php get_template_part('templates/head'); ?>
<body <?php body_class(); ?>>
<!--[if lt IE 7]><div class="alert"><?php _e('You are using an <strong>outdated</strong> browser. Please upgrade your browser to improve your experience.', 'roots'); ?></div><![endif]-->
<?php
do_action('get_header');
// Use Bootstrap's navbar if enabled in config.php
if (current_theme_supports('bootstrap-top-navbar')) {
get_template_part('templates/header-top-navbar');
} else {
get_template_part('templates/header');
}
?>
<div class="wrap container" role="document">
<div class="content row">
<div class="main <?php echo roots_main_class(); ?>" role="main">
<?php include roots_template_path(); ?>
</div><!-- /.main -->
<?php if (roots_display_sidebar()) : ?>
<aside class="sidebar <?php echo roots_sidebar_class(); ?>" role="complementary">
<?php include roots_sidebar_path(); ?>
</aside><!-- /.sidebar -->
<?php endif; ?>
</div><!-- /.content -->
</div><!-- /.wrap -->
<?php get_template_part('templates/footer'); ?>
</body>
</html>
Your question is trying to cover a lot of different points. A couple of observations:
If you don't completely understand Wordpress then I would strongly recommend you familiarise yourself with the WP documentation first.
Bootstrap is a framework; why don't you just build on top of it and use it as a starting point?
If you really don't want to use Bootstrap then it would be a lot simpler to switch to a different theme
Looking at the roots theme, there isn't bootstrap.css; there's main.min.css. You can either: A) edit that directly, B) prevent it from loading by commenting out line 14 of lib/scripts.php and enqueuing your own CSS or C) leave it as is and load your own CSS as an additional stylesheet by enqueuing it in 'lib/scripts.php`. To understand how to enqueue stylesheets in WP, refer to the WP Codex entry for wp_enqueue_style.
I'd strongly consider rethinking your question so that it is easier to answer, and maybe posting it as separate questions rather than one multi-faceted question.

Reusable user interface in PHP?

For most of my projects I make an administration interface, which has the same design for every project. The design of the header, the footer, the topbar, the leftmenu, the css, etc. are always the same. It is a pity to create the views every time; so I was thinking: maybe there would be a nice way to put the admin interface in my MVC library, as it is reused by every project?
But for the moment, in every single view I got code like the following:
<?php $this->_include('/includes/doctype.php'); ?>
<head>
<?php $this->_include('/includes/head.php'); ?>
<title>Some title</title>
</head>
<body>
<?php $this->_include('/includes/topbar.php'); ?>
<div id="page">
<?php $this->_include('/includes/header.php'); ?>
<?php $this->_include('/includes/leftmenu.php'); ?>
<div id="content" role="main">
<h1>Some title</h1>
<p>Blah blah blah.</p>
</div><!-- /#content -->
<?php $this->_include('/includes/footer.php'); ?>
</div><!-- /#page -->
</body>
</html>
Would it be a good idea to extract the custom content from the structure of the interface, and put that structure in my library somehow to make it reusable?
After that how will it be possible to customize the title and the actual menus?
I do this all the time. I have a custom header and footer file that are called at the start and end of every page.
<?PHP
Require("includes/header.php");
...
Require("includes/footer.php");
?>
The header provides a database handle, a datetime string and handles logon, priveleges, logging of pageviews etc.
The footer provides a standard HTML page but includes some systematised variables. It also generates the menu dynamically from the driving database then closes the database connection.
This way when I write code, I don't get mixed up in the HTML and any bugs are easy to find.
I like variables akin to:
$display_scripts - adds extra data in the head section.
$display_onload_scripts - adds onload scripts to body section.
$display_style_sheets - option to include link to additional stylesheets
$display_above_menu - will appear above the menubar. NOT recommended.
$display_below_menu - will appear immediately below the menubar.
$display_one_column - page contents when only one column is to be used
$display_left_column - page contents when two columns used. Left pane.
$display_right_column - page contents when two columns used. Right pane.
$display_footer - appears in footer division.
My main code then just has to generate the appropriate variable. Fundamentally, what you need to do is examine the source of a good age you have produced then replace the stuff you want to change with variables.
Here is a schematised version of the file I use (pseudocode) to give you an idea of how I do it.
// Code here generates the menu from database
// Code here genereates popup alert messages from other users
//permanent links to external style sheets go here.
//You can also select skins here.
<?PHP
echo $display_style_sheets;
echo "<title>".$display_page_title."</title>";
?>
<script type="text/javascript" src="JAVASCRIPT GOES HERE.js"></script>
</head>
<body <?PHP echo $display_onload_scripts;?> >
<div id="page_area" >
<div id="banner">
</div>
<?php
echo $display_above_menu;
if(!$hide_menu){echo $display_menu;} //Insert the menu variable here.
echo $display_below_menu;
?>
<div id="content_area">
<div id="inner_content">
<?PHP
if($display_number_of_columns==1)
{
echo "<div id='onecolumn'>".$display_one_column."</div>"; //I only use this one
}
if($display_number_of_columns==2)
{
echo "<div id='leftcolumn'>".$display_left_column."</div>"; //these are left for legacy support from before I got better at CSS.
echo "<div id='rightcolumn'>".$display_right_column."</div>";
}
echo "<div id='footer'>".$display_footer."</div>"; //just in case - I hardly use it.
echo $display_pop_box; //for user alert messages to other users
?>
</div>
</div>
</div>
<div id="logbox"> Automatic Logout statement</div> //this is called by JS to activate timeouts.
</body>
</html>
<?PHP
$mysqlidb->close();
?>
Sorry it's such a lot of code. The layout allows easy adaptation and makes it simple to find the offending variable if things are not going as expected. There are more elegant solutions but this works well for me and is very fast.

Categories