Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 07-25-2009, 05:43 PM   #1
Active Warrior
 
inetmilionaire's Avatar
 
Join Date: Apr 2008
Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
Social Networking View Member's Twitter Profile 
Default How can I learn to hack my WP sites with minimal PHP knowledge

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

inetmilionaire is offline   Reply With Quote
Old 07-25-2009, 11:54 PM   #2
Warrior, Interrupted
 
Join Date: Nov 2008
Location: Washington State
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Social Networking View Member's Myspace Profile  View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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.
LisaRussell is offline   Reply With Quote
Old 07-26-2009, 02:01 AM   #3
Senior Warrior Member
War Room Member
 
Steve Diamond's Avatar
 
Join Date: Apr 2006
Location: Tucson, AZ, USA.
Posts: 1,025
Thanks: 120
Thanked 158 Times in 115 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Steve Diamond
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

@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
Steve Diamond is offline   Reply With Quote
Old 07-26-2009, 08:56 PM   #4
A rat after money...
War Room Member
 
HomeBizNizz's Avatar
 
Join Date: Jul 2009
Location: Inside a cheese...
Posts: 598
Thanks: 363
Thanked 54 Times in 47 Posts
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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.

HomeBizNizz is offline   Reply With Quote
Old 07-27-2009, 02:45 PM   #5
HyperActive Warrior
 
Join Date: Aug 2008
Posts: 103
Thanks: 12
Thanked 13 Times in 13 Posts
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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

Find What You're Looking for Fast:
Real Work at Home - Homeworker Blog - Jobs for Homeworkers
aspiepower is offline   Reply With Quote
Old 07-27-2009, 07:25 PM   #6
Warrior Member
 
Join Date: Jul 2009
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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!
die() is offline   Reply With Quote
Old 07-31-2009, 05:32 AM   #7
Active Warrior
 
inetmilionaire's Avatar
 
Join Date: Apr 2008
Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
Social Networking View Member's Twitter Profile 
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

Thanks everyone. Anyone who knows of some online resources to do cool WP hacks with little knowledge would also be appreciated.

inetmilionaire is offline   Reply With Quote
Old 07-31-2009, 08:31 AM   #8
HyperActive Warrior
 
Join Date: Jan 2008
Location: Sunny Florida
Posts: 214
Thanks: 10
Thanked 22 Times in 19 Posts
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

Quote:
Originally Posted by inetmilionaire View Post
Thanks everyone. Anyone who knows of some online resources to do cool WP hacks with little knowledge would also be appreciated.
I think your question is on the right track and it really wasn't answered. HTML and CSS does not get you all the way with Wordpress. there are also what i called "template tags". They included PHP but you really are not required to know php to use them.

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.
nontemplates is offline   Reply With Quote
Old 07-31-2009, 10:38 AM   #9
Active Warrior
 
Join Date: Jul 2009
Posts: 34
Thanks: 0
Thanked 9 Times in 9 Posts
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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.
haikuangel is offline   Reply With Quote
Old 08-02-2009, 07:30 PM   #10
Active Warrior
 
inetmilionaire's Avatar
 
Join Date: Apr 2008
Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
Social Networking View Member's Twitter Profile 
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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.

inetmilionaire is offline   Reply With Quote
Old 08-02-2009, 09:06 PM   #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
Social Networking View Member's FaceBook Profile  View Member's YouTube Profile
Contact Info
Send a message via AIM to rbabi18 Send a message via Yahoo to rbabi18
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

Learn some html and cascading style sheets (css) and you should be able to accomplish what you want.

Get Free Information on MI Bankruptcy
rbabi18 is offline   Reply With Quote
Old 08-03-2009, 12:29 PM   #12
HyperActive Warrior
War Room Member
 
C A Perez's Avatar
 
Join Date: May 2009
Location: Rainier, WA
Posts: 121
Thanks: 46
Thanked 18 Times in 13 Posts
Social Networking View Member's FaceBook Profile  View Member's Twitter Profile 
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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
C A Perez is offline   Reply With Quote
Old 08-03-2009, 03:00 PM   #13
Warrior Member
 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 1 Time in 1 Post
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

header.php footer.php

If its in the wrong place, cut - paste to another place. Thats how I started learning.
shadowpwner is offline   Reply With Quote
Old 08-03-2009, 09:34 PM   #14
Wordpress Code Monkey
War Room Member
 
LibertyUnc's Avatar
 
Join Date: May 2009
Location: Earth
Posts: 94
Blog Entries: 1
Thanks: 21
Thanked 114 Times in 33 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via ICQ to LibertyUnc Send a message via Yahoo to LibertyUnc
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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>
Images:
The "img" tag, by itself.
HTML Code:
<img src="url_to_image_file_here" />
Most content is within other types of tags:

Paragraphs:
The "p" tag:
HTML Code:
<p>This is a paragraph</p>
The "div" tag:
HTML Code:
<div>This is a div, typically styled by css</div>
The "table" tag:
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>
contains one row in a table, which must contain at least one table data piece to be valid.

HTML Code:
<td></td>
contains a table data section, which defines a column

To begin, use the same number of
HTML Code:
<td></td>
sections in each
HTML Code:
<tr></tr>
section. To get more interesting tables, do a search for "colspan" and "rowspan" on the net.

Ordered Lists:
The "ol" tag:
HTML Code:
<ol>
<li>List item 1</li>
<li>List item 2</li>
</ol>
The Unordered List:
The "ul" tag:
HTML Code:
<ul>
<li>List item the first</li>
<li>List item the second</li>
</ul>
With the above, seeing what is going on with a page can be much simpler.

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>
section and sometimes a header and or left sidebar. It really depends on who wrote the theme. Personally, I only ever include
HTML Code:
<head>...</head><body>
in it...and body only because I include theme options to stuff extra things such as javascript in the body tag.

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
LibertyUnc is offline   Reply With Quote
Old 08-05-2009, 11:32 PM   #15
Active Warrior
 
inetmilionaire's Avatar
 
Join Date: Apr 2008
Location: Australia
Posts: 50
Thanks: 17
Thanked 5 Times in 5 Posts
Social Networking View Member's Twitter Profile 
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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.

inetmilionaire is offline   Reply With Quote
Old 08-09-2009, 02:39 PM   #16
Wordpress Code Monkey
War Room Member
 
LibertyUnc's Avatar
 
Join Date: May 2009
Location: Earth
Posts: 94
Blog Entries: 1
Thanks: 21
Thanked 114 Times in 33 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via ICQ to LibertyUnc Send a message via Yahoo to LibertyUnc
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

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>
That would make "some text" centered inside of its containing block and show it as being bolded and underlined.

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>
You could also simply use:
HTML Code:
.b-u-c { style information }
Which would let you apply the class="b-u-c" to just about anything.

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>
Setting default styling for html entities
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;
}
Once you see how it works it is simply a matter of becoming familiar with more tags, realizing which ones apply to which types of html tags, and then experimenting to get the look you want.

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
LibertyUnc is offline   Reply With Quote
Old 08-17-2009, 10:21 AM   #17
Active Warrior
 
Join Date: Aug 2009
Posts: 30
Thanks: 2
Thanked 3 Times in 3 Posts
Default Re: How can I learn to hack my WP sites with minimal PHP knowledge

Install it in your local computer, just play with it you will get experience, it is an time consuming.
sunsoftsystem is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
hack, knowledge, learn, minimal, php, sites

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 01:39 PM.