![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: Apr 2008 Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
|
I want to be able to learn how to add text to the theme of my blog, add links at the top, bottom, side of the blog, and other minor hacks that I won't have to spend forever learning PHP to implement. Does anyone know of any resources that teaches PHP newbies how to hack WP code to add links, pics, text etc. ? If was to try and learn only the PHP I need for WP modding purposes, what is the best book/online/offline resource you would recommend? Cheers all, IMil |
| | |
| | |
| | #2 |
| Warrior, Interrupted Join Date: Nov 2008 Location: Washington State
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
teach yourself- just start reading the code until you see patterns. if you don't know what something means, google it in quotation marks. good luck.
|
| | |
| | #3 |
| Senior Warrior Member War Room Member Join Date: Apr 2006 Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
|
@IMil: You really need little or no PHP knowledge to accomplish the kinds of changes you're talking about. What you need to know are HTML and CSS. In WP theme files, the PHP code provides the logical interface with the underpinnings of WP. But the HTML and the CSS do most of the work of displaying things. If you want to add things to an existing sidebar, you don't have to look inside the theme files at all. Go to the Widgets section of the Appearance menu and you can change the sidebar layouts around at will. You can add anything you like in a Text widget. To add things at the beginning or the end of each post, look in the theme files for the HTML that defines a post header (usually the H2 tag). Don't change the PHP. Just insert HTML in the spot where you want it. I hope this helps. Steve |
| Executive I.T. consulting for small/medium business Website development | PHP - MySQL - JavaScript expert programming Software requirements analysis | Specification writing Project management | Vendor relationship management | |
| | |
| | #4 |
| A rat after money... War Room Member Join Date: Jul 2009 Location: Inside a cheese...
Posts: 598
Thanks: 363
Thanked 54 Times in 47 Posts
|
It's mostly HTML/CSS anyway with some WP PHP code bits... ![]() If you hack the plugins/WP core it will reset during a update of the WP core/plugin. I had to hack some plugins due to layout problems. A real pain in the ass. |
| | |
| | |
| | #5 |
| HyperActive Warrior Join Date: Aug 2008
Posts: 103
Thanks: 12
Thanked 13 Times in 13 Posts
|
When I do this, I go into Appearance, Editor, then look round for the start/end of what are obvious programming blocks and then type *** when I can see that a code block, or section, or area seems to have finished. I then save that, refresh my page and look for where the *** turns up ... if it's in the right place I go back into the Editor and add what I wanted there. I use this to place advertising blocks mainly. Very crude, but it works |
| | |
| | |
| | #6 |
| Warrior Member Join Date: Jul 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
php is the easiest programming language there is. When I started with php, it was due to demand, and I was able to make my own custom site within 2 weeks. If I can do that, you can learn a little about WP!
|
| | |
| | #7 |
| Active Warrior Join Date: Apr 2008 Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
|
Thanks everyone. Anyone who knows of some online resources to do cool WP hacks with little knowledge would also be appreciated.
|
| | |
| | |
| | #8 | |
| HyperActive Warrior Join Date: Jan 2008 Location: Sunny Florida
Posts: 214
Thanks: 10
Thanked 22 Times in 19 Posts
| Quote:
Besides tags as someone else suggested the PHP in Wordpress is not that hard. For example this might look complicated <?php include (ABSPATH . '/wp-content/plugins/dynamic-content-gallery-plugin/dynamic-gallery.php'); ?> </div> BUt all it is doing is including a file at that point in the theme that calls for a plugin. another example - the famous loop <?php if (have_posts()) : while (have_posts()) : the_post(); endwhile; else: ?> <?php endif; ?> again looks complicated but all it does is look for a post finds it, moves to the next post finds it and if it doesn't find anymore posts it stops. Understanding these little snippets without even understanding the php in them makes a WORLD of difference. It gves you a control over your site that allows you to do almost anything you want. I'm doing a video series about this but didn't know if enough people were really interested. | |
| | |
| | #9 |
| Active Warrior Join Date: Jul 2009
Posts: 34
Thanks: 0
Thanked 9 Times in 9 Posts
|
Hi From what I understand, its not a knowledge of PHP that is required to do the task but a good grasp of CSS and HTML. Most of the changes that you want to do for your pages are easy to create, these tweaks are manageable just brush up on your HTML and CSS coding and if you get confused there are several coding cheatsheets available on the web.
|
| | |
| | #10 |
| Active Warrior Join Date: Apr 2008 Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
|
nontemplates: you are right on the money. I don't really want to know the code in detail, but rather to spot snippets of code that will help me get an idea about what is going on in the code. If you are putting together a video series, then keep going! Like marketing suggests, my interest represents another hundred customers ![]() If my query also suggest some knowledge of CSS/HTML is required, then is there any coding tricks specific to Wordpress I may need? Maybe you could put that in your video series, too. To be able to add a string of text somewhere onscreen outside the normal widgets or tools, or to add a CPA offer or something useful like that, these are the little tricks I would like to be able to do. Ultimately its about knowing your code, but when I don't know where to start it kind of kills any desire to understand, especially with little time on my hands. I look forward to the offer on your vids. |
| | |
| | |
| | #11 |
| Super-Affiliate Training War Room Member Join Date: Jan 2009 Location: Detroit, Michigan USA
Posts: 30
Blog Entries: 2 Thanks: 9
Thanked 1 Time in 1 Post
|
Learn some html and cascading style sheets (css) and you should be able to accomplish what you want.
|
|
Get Free Information on MI Bankruptcy | |
| | |
| | #12 |
| HyperActive Warrior War Room Member Join Date: May 2009 Location: Rainier, WA
Posts: 121
Thanks: 46
Thanked 18 Times in 13 Posts
|
Started 3+ months ago. Created my first website with google - yuck! Just created my second with WP. Mind you, three months ago I knew nothing about any of this: domains, HTML, hosting, CSS, etc. But by jumping in and trying something, and using Warrior Forums, Wordpress.org forums, and google to educate myself and correct my mistakes, I've done it! It may not be the best, but it's mine. I'll continue to tweak along the way. Thanks to everyone for your posts. I'm learning. I just did. Carlos |
| | |
| | #13 |
| Warrior Member Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
|
header.php footer.php If its in the wrong place, cut - paste to another place. Thats how I started learning.
|
| | |
| | #14 |
| Wordpress Code Monkey War Room Member Join Date: May 2009 Location: Earth
Posts: 94
Blog Entries: 1 Thanks: 21
Thanked 114 Times in 33 Posts
|
It really depends on what you want to do. From the sounds of it you would probably learn fastest by looking at what is there and trying to edit things. To put things in sidebars, try using the text widget and then placing your content within the text widget. That works well for most things. Just as a quick help/intro type piece: HTML is primarily made of pairs of tags, which contain particular things in them. Links: The "a" tag with the text or item to be linked contained within: HTML Code: <a href="your_url_here">words or image here</a> The "img" tag, by itself. HTML Code: <img src="url_to_image_file_here" /> Paragraphs: The "p" tag: HTML Code: <p>This is a paragraph</p> HTML Code: <div>This is a div, typically styled by css</div> HTML Code: <table> <tr><td>row 1 column 1</td><td>row 1 column 2</td></tr> <tr><td>row 2 column 1</td><td>row 2 column 2</td></tr> </table> HTML Code: <tr></tr> HTML Code: <td></td> To begin, use the same number of HTML Code: <td></td> HTML Code: <tr></tr> Ordered Lists: The "ol" tag: HTML Code: <ol> <li>List item 1</li> <li>List item 2</li> </ol> The "ul" tag: HTML Code: <ul> <li>List item the first</li> <li>List item the second</li> </ul> When looking at theme files, you can get fairly good mileage by simply ignoring the php and looking at the above tags, seeing what is in them, and figuring out where the piece you want to modify is. Also, take note of the heirarchy and page types. Wordpress looks for pages in the following order and most themes lack most of the following...so you need to know what file is serving up the page you are looking at: Pages listed to the left are used if provided, then those to the right are used if not. Everything leads back to index.php. Date Archives: date.php > archive.php > index.php Category Archives: category-#.php > category.php > archive.php > index.php Tag Archives: tag-SLUGNAME.php > tag.php > archive.php > index.php Author Archives: author.php > index.php Home Page: home.php > index.php "Page" pages: pagename.php > page.php > index.php Search result pages: search.php > index.php Page not found (404) pages: 404.php > index.php Posts: single.php > index.php Image pages: image.php > attachment.php > single.php > index.php Video pages: video.php > attachment.php > single.php > index.php Audio pages: audio.php > attachment.php > single.php > index.php Application pages: application.php > attachment.php > single.php > index.php Finally, many themes use the following files: header.php: To draw the html HTML Code: <head> </head> HTML Code: <head>...</head><body> index.php (or one of the above files from the heirarchy ) This normally does most of the work. footer.php Typically to display some end piece of the page...how much depends on the coder. My footers generally contain any bottom content that spans multiple columns above as well as the </body></html> and that is about it. For html and php, if you want to know what something is, I recommend: php.net (for php). Read the first couple chapters of the reference manual and you will be good to go for most things. w3.org (for html and css). Read the HTML specifications or just search for the tags you want more information about. |
| PWS WP Ad Manager Plugin: An ad spot and ad block placement tool for wordpress. The Privateer Theme: See my WSO to get the Ad Manager and the Theme for a steal while supplies last. "Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it." ~ Thomas Paine | |
| | |
| | #15 |
| Active Warrior Join Date: Apr 2008 Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
|
LibertyUnc: Wow! Thanks! I am a bit of a deever with HTML, that is to say, I am competent enough to put together a decent sale-able page and hack code where I need to. CSS is my downfall - I do not know CSS links to HTML or its coding. Also I know nothing of PHP but die() says its easy - I am an x-hobby programmer so I reckon I should pick it up in a snap. I have a great book on PHP in a box somewhere that unfortunately has been buried due a recent move - bummer! Anyway I will go to w3.org and check out info on CSS so thanks for that reference. Your other references on the internal working of WP was definitely cool - I pasted this into a doc and will keep it handy when I look further into it. OK! Well my goals are 1. To learn how to put in a CPA ad in my WP blog; 2. Learn how to put that CPA ad in a position on my blog that is not 'automatic' (probably something to do with header/footer.php, and on the side is probably a widget); 3. To determine if I can put adsense into a theme that is not adsense activated. If anyone can answer this definitely, many blessings upon you. OK! Cheers everyone, esp. Liberty Unc, and L.U. I like your signature quote. |
| | |
| | |
| | #16 |
| Wordpress Code Monkey War Room Member Join Date: May 2009 Location: Earth
Posts: 94
Blog Entries: 1 Thanks: 21
Thanked 114 Times in 33 Posts
|
Very welcome. I'm actually putting together a little wp plugin that will let people place a small snippet of code wherever they want (in posts, pages, index.php, etc. ) and have it serve up a specified (or rotated) offer in that spot. It's more to explain how to do it than anything, but I figured if I was going to go over the ins and outs of creating plugins I'd create something semi-useful. CSS is pretty simple, but can become a pain due to differences in browsers ( particularly ie ) and the sheer number of different attributes there are to remember. That said, it boils down to the following: Using id=, class=, and style= Most tags will accept an id, class, and/or style attribute. style="(attribute_list)" is meant for setting style information directly. class="(attribute_list)" is meant for creating a particular style that you will reuse where you want to id="(attribute_list)" is meant for the same thing as class, but it should be limited to one id per page so that it can be properly referenced via scripts. for example: HTML Code: <p style="font-weight: bold; text-decoration: underline; text-align: center;">some text</p> If you created a <style></style> section inside of the html <head></head> tags ( or created a stylesheet and referenced it in the header ) then you could do this for the same effect: HTML Code: p.b-u-c {
font-weight: bold;
text-dectoration: underline;
text-align: center;
}
<p class="b-u-c">some text</p> HTML Code: .b-u-c { style information } The "." denotes that you reference it with class="". If you want to set an id, then you use # instead... HTML Code: div#b-u-c { style information here }
<div id="b-u-c">The things in your div</div> Additionally, you can set default looks for things by simply setting up their tags. Perhaps you want all paragraphs to have 0.125 em of space above them. You could do the following: HTML Code: p {
margin-top: 0.125em;
} |
| PWS WP Ad Manager Plugin: An ad spot and ad block placement tool for wordpress. The Privateer Theme: See my WSO to get the Ad Manager and the Theme for a steal while supplies last. "Those who expect to reap the blessings of freedom must, like men, undergo the fatigue of supporting it." ~ Thomas Paine | |
| | |
| | #17 |
| Active Warrior Join Date: Aug 2009
Posts: 30
Thanks: 2
Thanked 3 Times in 3 Posts
|
Install it in your local computer, just play with it you will get experience, it is an time consuming.
|
| | |
![]() |
|
| Tags |
| hack, knowledge, learn, minimal, php, sites |
| Thread Tools | |
| |
![]() |