Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   What are the percent and pipe symbols for in the post info section ... (http://forum.bytesforall.com/showthread.php?t=2055)

fromtheranks Jun 15, 2009 03:18 PM

What are the percent and pipe symbols for in the post info section ...
 
These are undoubtedly newbie questions but I've been digging through PHP, CSS and HTML references trying to figure out what:

1. the darn "%" is; for but one example: %date('F js, Y') %

2. and, does it make any difference if it is entered as: % date('F js, Y') % ... or ... %date('F js, Y')% ... or as above in #1. The placement of the % seems to have no significance, as long as there are two of them, but I'm not sure.

3. finally, ditto for the pipe (|) symbol. In UNIX it is for redirection but I don't believe that is the case here. I did find one reference (finally) buried on a PHP site that seemed to suggest this was an OR operator, but that doesn't entirely make sense in the Post Info Items area.

If someone could give me a brief tutorial on these two symbols, so that when I'm editing the info items I don't inadvertently mess it up by not understanding the syntax, I'd appreciate it.

Thanks in advance.

fromtheranks Jun 16, 2009 01:24 PM

Update: as a "duhhhh", I finally "figured out" that the pipe symbol, in this case, is a visual divider ... very cleverly coded so that it shows up only when appropriate. Sometimes it takes a while to notice the obvious. :)

However.

I still can't track down data on the below mentioned sites on the percent pair: %<whatever>%. Let alone, formatting rules for them.

Anyone?

Thanks in advance.

juggledad Jun 17, 2009 05:29 AM

I believe the % pairs are place holders to indicate an option to be changed, i.e.

Lets say you wanted to write some code to parse a line of VARIABLE text and substitute some info that the user gives you. The input text could be: 'One day I want to own a %aniaml%' or 'I have a %animal% as a pet'. If you have a variable $animal='elephant', the code sould scan each of the different text lines, outputting each character until it came to a % sign, it would look for the next one, and if it finds it, it would look to see what was in between (with the %), in this case it would have '%animal%' and it would substitute 'elephant' and then continue processing the remaining text.

Does this help?

fromtheranks Jun 17, 2009 11:39 AM

Juggledad,

Thank you! Perfect answer, i.e. as soon as I read it I went "Of course!". :)

Some of the syntax of CSS, PHP, and so on, is kind of hard to track down because you can't search on %, or whatever, and get any kind of meaningful answer.

Yet another that got me was trying to clarigy the meaning and purpose of the stand-alone "a", in the CSS insert from the link: http://forum.bytesforall.com/showthread.php?t=2068.

I'm still not sure I have it exactly right (although Shedhed has tried to explain it to me in an off-line e-mail) but it seems to represent a link in its default or neutral state ex: "#breadcrumb a {display: inline; ...". But how the heck do you find its definition? Even with Shedhed's explanation I still can't find a clean reference on it (tried w3cshcools, etc., half a dozen ways and no luck).

Another example is having to match CSS pound signs (#'s) to php ID declarations and CSS periods (.) with php CLASS declarations ... as I just "discovered" with everyone's help by way of solving the issue in the above thread.

Which is a long and round about way of saying thank you for answering such questions, it is a very real enabler that helps us newbies figure out what the heck we're doing. :)

juggledad Jun 18, 2009 06:14 AM

Let me see if I can give you a breif expainition.

In each of the HTML elements (<body>, <div>, <h1>, <p>, <ul>. <li>, <a> etc) you can add eithor a 'class=' or an 'id='. CLASS can be used on many elements, but ID is used just for one element on the page. Using an ID will overlay the styles of a CLASS if they both reference the same ELEMENT ( the <div>, <a> etc)

In CSS you need to identify what class/id you are referencing. The CLASS="xxx" uses the period ('.') as it's identifier, while the ID="yyy" uses the pound sign ("#").

Since a class can be used on many elements, if the style you are appling only effects one element, you need to identify it. Let's say you have a <p class="intro"> and <a href="#" class="intro">. If you just used the .intro {color: red;} it would effect them both. If you used a.intro {color: red;} you would only effect the <a href="#" class="intro">

and there are decendent selectors (how to effect the <a. that is in an <li> that is in a <div>) universal selectors ect. I good book I found is 'Sams Teach Yourself CSS in 10 Minutes'

Hope this helps

fromtheranks Jun 18, 2009 12:14 PM

This definitely helps. Thank you. And. Time to go on amazon and buy a book. :)


All times are GMT -6. The time now is 12:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.