At the bottom in the footer I am using the following php code:
<?php get_links(21, '<span>', '</span>', ' | ', TRUE, 'url', FALSE); ?>
It works fine, except I want to separate each city using the PIPE (|) character so that the cities displayed will like this:
Allied Gardens | Bay Park | Carmel Valley | Chula Vista | Clairemont | College | College Grove | etc.
This is meant to be a navigation for featured communities in the footer.
Open to Suggestions, please.
]]>print $links;
Please note that if you set the show images argument to be TRUE then it doesn’t print the link title… if you set it to FALSE it prints the link title but obviously not the image.. how do you print both the link title and the link image?
kind regards to any responders J.
<h3>Friends</h3>
<ul>
<?php get_links(2, '<li>', '</li>', '', TRUE, 'rating', FALSE); ?>
</ul>
</div>
as you see the link-category name Friends is by hard code.
can it be “get from the name”
I saw a post on this but the answer was unclear.
I want to loop through the links list (blogroll) and have the categories display for each set of links. I have the links working as I want, but being unfamiliar with PHP and WordPress I’m not sure how to proceed.
I found the <?php wp_get_links(category); ?> attribute that I think will do what I want, but if someone could please post how to put this all together, that would be so very helpful.
Thank you!
Category
Link
Link
Category
Link
Link
etc….
My code so far — this works fine but obviously no categories…
<?php get_links (with attributes)…>
]]>What I’m planning is to make a derivative function of the get_links() function. The problem is that I can’t seem to rundown where the get_links() function is defined. I looked at this page https://codex.www.ads-software.com/Template_Tags/get_links which talks about the function, but doesn’t (from what I can see) tell me in which file the function lives.
Can someone point me in the right direction? Alternately, is there a better way to go about this? I’m a PHP hacker, so my inclination is to fire up vim and go to work, but if there’s another way, I’d like to learn.
]]>I just updated from version 2.0.5 to 2.1.3. After doing that I realized that function get_links() no longer returned the links I was having. I used it like this:
<?php get_links(1, '<li>', '</li>', '', FALSE, 'name', FALSE, FALSE, -1, FALSE); ?>
where 1 is the id of a category called blogroll. (I have several, this is just an example). After debugging through the code, I realized that where was something wrong with the function get_bookmarks() which is called by get_links().
At some point, there is this piece of code
foreach ( $incategories as $incat ) {
if (empty($category_query))
$category_query = ' AND ( category_id = ' . intval($incat) . ' ';
else
$category_query .= ' OR category_id = ' . intval($incat) . ' ';
The use of the field category_id doesn’t seem to be correct there. If I change it to link_category, which is the actual name of the field in my links table, everything works fine. Or at least I haven’t seen side effects yet.
I have several questions: why did this happen? Is it a bug? I did not change anything in the database, only updated the software. Is it likely that my change would break other parts of the blog? Should I change the use of get_links() with something else?
Thank you very much,
Marius Bancila
(am reposting this, I put code in my first post and think I borked the internet, sorry, my bad. )
All of the links that were originally in my sidebar suddenly disappeared. This was expected (I guess) as the wordpress developers have apparently deprecated get_links and several other link tags.
After digging I found that wp_list_bookmarks is the appropriate tag to use in your theme. So I edited the following:
<div class="menuheader"><div><?php _e('Find Build Shop:'); ?></div></div>
<ul id='br_list'>
<?php get_links(2,'<li>','</li>',' ',false,'name',false,false,-1,false,true);; ?>
</ul>
to read only:
<div class="menuheader"><div><?php _e('Links:'); ?></div></div>
<?php wp_list_bookmarks('categorize=1&category_name=emulators'); ?>
I have one link category called emulators. However, now all of the links show up all of the time and I’m not able to use any categorization objects specified here: https://codex.www.ads-software.com/Template_Tags/wp_list_bookmarks properly. They simply break and the entire list of links is then displayed.
I’ve tried tons of different syntax and even used the examples on this page to no resolution.
Any help would be much appreciated.
I’m using WordPress 2.1.3 and have a heavily modified theme designed for https://www.gridcycle.com/ based on the original neuron theme.
]]><?php get_links(5, '', '', '', true, '_id', false, false, 3, false); ?>
Here is what is was at version 2.0 working just fine. Whats the problem and how do I fix it?
]]>Can anyone help me out here?
I want to wrap the link around the description as well as the title when using the get_links tag. Does anyone out there know of this is possible?
This is what I am getting
<div id="quicklinks">
<h2>Quick Links</h2>
<ul>
<li><a href="https://www.fecalface.com" title="description">Fecal Face</a><br />description</li>
</ul>
</div>
This is what I really need:
<div id="quicklinks">
<h2>Quick Links</h2>
<ul>
<li><a href="https://www.fecalface.com" title="description">Fecal Face<br />description</a></li>
</ul>
</div>
Basically with CSS I want to make these block links that I can maybe change colour whe they hover.
Thanks
]]>