Community Forums › Forums › Archived Forums › General Discussion › Editing files from the back end
Tagged: genesis
- This topic has 6 replies, 4 voices, and was last updated 9 years, 1 month ago by Phids.
-
AuthorPosts
-
February 18, 2015 at 2:42 pm #141241PhidsMember
I am just starting out with Genesis and am having difficulty figuring out how to edit certain aspects of my site via FTP, pretty much using any Genesis child theme. I'll use the Focus Pro theme as an example, but this seems to apply to the other themes I've tried out as well. If I want to do something as simple as to remove the "Posted on February 17, 2015 Written by...", where would I edit this code? Or, if I wanted to insert a simple line into the header to display some text underneath a logo (let's say for this example that this is not something allowed by the front end), how would I do this?
I understand that core Genesis folders should not be edited, or at least not overwritten with edited files, so that's not what I want to do. I am fine with placing the files in the child theme, but I would like to know if I'm able to edit these files in the first place.
Basically, I know that it's easy enough to make these changes in themes that do not use the Genesis Framework, and I hope that using Genesis allows the same freedom of customization.
February 18, 2015 at 11:00 pm #141268ramseypMemberHi there.
You can absolutely edit your child theme to do what you want. The major difference will be, however, becoming comfortable with two concepts:
1) The abstraction in Genesis theme code, as opposed to other themes, especially stand-alone themes.
2) How WordPress child themes use template files in relation to the parent theme.First, the abstraction.
Let's say you're in something like TwentyEleven. There you might have an page.php file, withget_header()
at the top, a loop, with the HTML tags mixed in there, and thenget_footer()
at the bottom. The same is true for index.php, single.php, etc.Genesis has a single primary function that's at the bottom of each page/post template:
genesis();
This function runs, loading up all the pieces necessary to build what ever page you're viewing. All these pieces can be modified to some degree by you writing a custom function and either adding it to an action or filter, or by replacing a default function with one of your own. You can find lots of examples in the My StudioPress part of this site, on various blogs, or throughout Github.Child theme template files
With child themes, you don't have to have every template file present. You can let WordPress use template files instead. My personal rule of thumb is to have as few template files in my child theme as I can get away with. WordPress will use a child theme's template instead of the parent's template ( of the same name ) if it's present in the child theme directory. The one exception isfunctions.php
. The parent'sfunctions.php
will always be loaded, in addition to the child theme's.So -
You can override or custom a piece of functionality, or how something looks by writing a function to do so and add it to an action or filter. You'd place this code in your child theme's
functions.php
, or, if you need to isolate your customizations to a particular type of content, you could create the necessary template file in your theme's directory - your code being written in that template file - as long as the last thing in your template file is:genesis();
Does that help? I hope I didn't go either way over your head or way under.
February 19, 2015 at 4:03 pm #141372PhidsMemberThank you for the detailed explanation, and for the advice about best practices. I think I understand the gist of it, and by browsing through the forum I found that at least some of this (e.g. removing elements) is handled by css.
With that said, I am still confused about adding items (e.g. to the header). Based on what you said, it sounds like I will need to add something to
functions.php
, following some of the examples that are provided in My StudioPress.Alright, I will have to check the example functions. I hope it's not too hard to do. I recently purchased the Genesis pro pack and figured I could test it out for 30 days; I may or may not request a refund based on how well I am able to approach the learning curve. Thanks again for your help.
February 19, 2015 at 7:33 pm #141390Victor FontModeratorThe easiest way to edit the post meta data is to install the Genesis Simple Edits plugin.
The site's description is often used as text under the logo. It's display is easily manipulated through css.
Nick the Geek, a former moderator for this site, has a great set of tutorials for learning how Genesis works: http://designsbynickthegeek.com/tag/genesis-explained
Regards,
Victor
https://victorfont.com/
Call us toll free: 844-VIC-FONT (842-3668)
Have you requested your free website audit yet?February 20, 2015 at 11:35 am #141487PhidsMemberThanks for the tip, Victor. I didn't think to consider Genesis plugins to accomplish some common tasks, but I did try out Simple Edits after your suggestion. I also looked at the hooks tutorial, and that seems to be my best best if I want to insert customized code in various parts of the templates.
My last question - a beginner one - I understand the importance of modifying child themes only, but I want to make sure the actual location of the files that I am supposed to be modifying is correct. For example, if I am modifying
functions.php
for the Altitude Pro, theme, I need to modifywp-content/themes/altitude-pro/functions.php
, correct? And any additional php files I create for hooks should go inwp-content/themes/altitude-pro/
? I just want to make sure that I don't need to put this into any separate folder (as one needs to do for themes without Genesis).February 20, 2015 at 12:12 pm #141501Brad DaltonParticipantUse FTP and a code editor like Notepad++
Download your child themes functions.php file and use one of these code snippets
http://my.studiopress.com/snippets/entry-header#customize
February 20, 2015 at 12:56 pm #141516PhidsMemberWow, thanks so much. I didn't know about that snippets archive, but it looks like it will come in very handy. BTW, I regularly use Notepad++; such a great, free tool!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.