View Full Version : Wordpress help please.
JCsDesignz
02-15-2006, 03:51 PM
Ive got it installed along with some plugins but i cant get the :: LINKS :: text to center.
Yes i know it needs <p align="center"> but it wont work LOL
I have all the other headers are centered but the links one is done in the links section and for some reason doesnt want to co-operate.
Any tips would be great and please dont send me to WP's help page. I cant make head nor tale of it LOL
http://jcsdesignz.com/wp/
Thank you.
smiffy
02-15-2006, 04:32 PM
Change this:
<li id="linkcat-1"><h2>:: LINKS ::</h2>
<ul>
<li><a href="http://jcsdesignz.com/wp/" rel="me" title="Home page">HOME</a></li>
<li><a href="http://jcsdesignz.com" title="Shop, Free, Members">MY MAIN SITE</a></li>
<li><a href="http://">TEST</a></li>
<li><a href="http://">TEST</a></li>
</ul>
</li>
to this:
<li><h2>
<p align="center">:: LINKS ::</h2>
<ul>
<li><a href="http://jcsdesignz.com/wp/" rel="me" title="Home page">HOME</a></li>
<li><a href="http://jcsdesignz.com" title="Shop, Free, Members">MY MAIN SITE</a></li>
<li><a href="http://">TEST</a></li>
<li><a href="http://">TEST</a></li>
</ul>
</li>
Should do the trick ... I think. Heh.
JCsDesignz
02-15-2006, 04:39 PM
OK i can see that but where do i edit it. Ive got nothing that looks like that. The Links bit is in a different section to the rest. Unless im missing something of course LOL
Edit ::
This is what i have the part in blue needs to have :: LINKS :: and centered (see the categories bit below) :)
<!-- Links -->
<?php get_links_list(); ?>
<li><h2>
<p align="center">:: Categories ::</h2>
<ul>
<?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
</ul>
</li>
2notch
02-15-2006, 07:21 PM
Ok JC, I think I found it. This is what you want to edit:
public_html/wp/wp-includes/links.php
On line 548 you have this:
echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2>' . $cat['cat_name'] . "</h2>\n\t<ul>\n";
Change it to this:
echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2><p align="center">' . $cat['cat_name'] . "</h2>\n\t<ul>\n";
I tried this on a fresh install of WP from Fantastico and it worked fine. As you can see here (http://danielsgrp.net/wp2/) it centers the word "Blogroll".
Test your other pages after modifying to make sure this hack doesn't hose up anything else.;)
smiffy
02-16-2006, 01:34 AM
I only had your page source code to go on. :)
JCsDesignz
02-16-2006, 03:31 AM
Ok JC, I think I found it. This is what you want to edit:
public_html/wp/wp-includes/links.php
On line 548 you have this:
echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2>' . $cat['cat_name'] . "</h2>\n\t<ul>\n";
Change it to this:
echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2><p align="center">' . $cat['cat_name'] . "</h2>\n\t<ul>\n";
I tried this on a fresh install of WP from Fantastico and it worked fine. As you can see here (http://danielsgrp.net/wp2/) it centers the word "Blogroll".
Test your other pages after modifying to make sure this hack doesn't hose up anything else.;)
Perfect. It worked beautifully. Thank you for your help. :D
JCsDesignz
02-16-2006, 03:32 AM
I only had your page source code to go on. :)
No problem. I appreciate the help :)
walker
02-19-2006, 11:00 AM
Ok JC, I think I found it. This is what you want to edit:
public_html/wp/wp-includes/links.php
Bear in mind that when you upgrade Wordpress, this file and all of its changes will be wiped out. Apply style changes directly to the theme files (either XHTML in sidebar.php or CSS in style.css) and there's no chance of them being lost. (Click Presentation in your Admin panel to edit these files directly.)
Modify anything in wp-includes or wp-admin at your peril. Wordpress upgrades appear several times a year (there has been one major and one minor update so far in 2006 alone), and sometimes its essential that they're applied for security reasons.
2notch
02-19-2006, 04:34 PM
Walker is absolutely correct about modifying those files and that's why you should keep a note file on the changes you make. In this case, the change could not be made in sidebar.php nor CSS. Changing "<h2>" in CSS would make *all* h2's center and that might be an undesirable result.
So, keep notes!
walker
02-19-2006, 05:08 PM
Walker is absolutely correct about modifying those files and that's why you should keep a note file on the changes you make. In this case, the change could not be made in sidebar.php nor CSS. Changing "<h2>" in CSS would make *all* h2's center and that might be an undesirable result.
Not true. If CSS was that flawed, there would be no point in using it.
The H2 elements in your sidebar are nested within a div with the ID "sidebar". So you define the style in #sidebar h2 { } and it will be applied to all H2 elements in your sidebar only. If you just want to customize a single H2 element (not all of those occurring in the sidebar), open up sidebar.php and give the H2 element in question a unique ID.
It's so much easier in the long run. The notes build up and when the Wordpress team drastically alters the code so that it's not a simple case of finding and replacing text, you find yourself with more work on your hands than you'd anticipated when the upgrade arrives. And it's just so unnecessary...by design (this kind of portability is actually one of Wordpress's strengths).
2notch
02-19-2006, 06:28 PM
The H2 elements in your sidebar are nested within a div with the ID "sidebar". So you define the style in #sidebar h2 { } and it will be applied to all H2 elements in your sidebar only. If you just want to customize a single H2 element (not all of those occurring in the sidebar), open up sidebar.php and give the H2 element in question a unique ID.
The above is true, however the code in question is not in sidebar.php. The "get_links" function has been moved to the left "sidebar" and the CSS to control the layout is:
#menu ul h2
{
background-color: #D7ACA5;
border-bottom: 1px dashed #943151;
border-top: 0px dashed #943151;
font-size: 1.0em;
font-weight: normal;
padding: 2px;
margin-bottom: 5px;
text-transform: uppercase;
text-align: center;
}
So by adding "text-align: center;" it has taken care of centering all h2's under the "menu" div.
I stand corrected...the hack wasn't necessary.
walker
02-19-2006, 07:57 PM
The above is true, however the code in question is not in sidebar.php. The "get_links" function has been moved to the left "sidebar" and the CSS to control the layout is:
So by adding "text-align: center;" it has taken care of centering all h2's under the "menu" div.
I stand corrected...the hack wasn't necessary.
Heh! I stand corrected too. But between us, we found the right tree to er bark up. ;)
2notch
02-19-2006, 08:16 PM
:o ...sometimes I can't see the forest because I'm looking too closely at the tree!
lorahrai
02-21-2006, 10:44 AM
Ok JC, I think I found it. This is what you want to edit:
public_html/wp/wp-includes/links.php
On line 548 you have this:
echo ' <li id="linkcat-' . $cat['link_category'] . '"><h2>' . $cat['cat_name'] . "</h2>\n\t<ul>\n";
I don't know if I am stupid or if I have a mental block, but I had so much trouble figuring out wordpress that I finally gave up. I went to the wp site and the wp wiki over and over again. I think there was just too much information for me to process. I kept losing track of what I was trying to do because each step in the tutorials referenced other steps that I had to go get. I even tried printing out a large portion of the wp tutorial. I had papers all over the place and it was a disaster.
Does anyone know of a very simple tutorial that takes you step by step, in order, and that is small enough to print out, so I don't have to keep switching between several different screens?
Also, how do you know what line you are on? I put on the show the line number feature in homesite 4.5, but the lines never matched up to what the tutorials were talking about.
I am really embarrassed that I can't seem to get this, but I figure that I can't lose anything by asking. I am really not stupid, but blogging is all new to me and I seem to find myself like I was many years ago back in school with a "math block" <g>
Thanks
JCsDesignz
02-21-2006, 11:56 AM
I got it sorted thanks everyone LOL
If anyone else wants it i joined an email group that has a great bunch of people that all help each other.
Ive managed to get mine ready for content to be added now LOL
http://jcsdesignz.com/wp/
The group link if anyone wants it is
http://groups.google.com/group/wplb
:)
2notch
02-21-2006, 01:16 PM
Does anyone know of a very simple tutorial that takes you step by step, in order, and that is small enough to print out, so I don't have to keep switching between several different screens?
What is it you are trying to do? Modify the code?
Also, how do you know what line you are on? I put on the show the line number feature in homesite 4.5, but the lines never matched up to what the tutorials were talking about.
Sometimes the editors count lines differently.What you want to do is look "on or about" line 548. Then look for the actual code you need to change.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.