I have a theme which lists my pages in a horizontal menu, with drop down sub-menu items for the sub-pages. I wanted to add a menu item for categories, so I added the following code to my menu.php script ... Code: <?php wp_list_categories('sort_column=name&sort_order=asc&include=22,24,25&style=list&children=true&hierarchical=true&title_li=' . __('Memberships') . ' ''); ?> But, when the page was rendered, there was no margin between the menu item separator and the menu text, so I added spaces into the title so that the ('Memberships') part of the code became (' Memberships ')...
Need help getting category menu to format
17
I have a theme which lists my pages in a horizontal menu, with drop down sub-menu items for the sub-pages. I wanted to add a menu item for categories, so I added the following code to my menu.php script ...
But, when the page was rendered, there was no margin between the menu item separator and the menu text, so I added spaces into the title so that the ('Memberships') part of the code became (' Memberships ')...
There was no change, as it appeared Wordpress had stripped the spaces out. So I did a little research, and added a div with float and margins ...
I got the left margin spaced, but the right margin was again stripped out. So I played with it and found that by adding a space and a character to the ('Memberships') part of the code, making it ('Memberships |'), I could simulate a right margin. (I used the pipe symbol trying to be unobtrusive.) The code is ...
You can see the results at Consultant Supply Room (Note that the categories aren't listed unless you are logged in. This question is only about getting a margin to appear in this added menu item.)
Can someone advise me of a way to get the menu item to include the right margin? Or, how to find out what is causing the problem? I don't know if it is being stripped out by the theme or Wordpress.
Thanks in advance,
Kirk
Code:
<?php
wp_list_categories('sort_column=name&sort_order=asc&include=22,24,25&style=list&children=true&hierarchical=true&title_li=' . __('Memberships') . ' '');
?> Code:
<?php
wp_list_categories('sort_column=name&sort_order=asc&include=22,24,25&style=list&children=true&hierarchical=true&title_li=' . __(' Memberships ') . ' '');
?> Code:
<div class="kwadded" style="float:left; margin-left: 10px; margin-right: 10px;">
<?php
wp_list_categories('sort_column=name&sort_order=asc&include=22,24,25&style=list&children=true&hierarchical=true&title_li=' . __('Memberships') . ' '');
?>
</div> Code:
<div class="kwadded" style="float:left; margin-left: 10px;">
<?php
wp_list_categories('sort_column=name&sort_order=asc&include=22,24,25&style=list&children=true&hierarchical=true&title_li=' . __('Memberships |') . ' '');
?>
</div> Can someone advise me of a way to get the menu item to include the right margin? Or, how to find out what is causing the problem? I don't know if it is being stripped out by the theme or Wordpress.
Thanks in advance,
Kirk
- Tim Brownlaw
- Kirk Ward
- [1] reply
- Tim Brownlaw
- [1] reply
- Kirk Ward
- [1] reply
- Tim Brownlaw
- [ 1 ] Thanks
- Kirk Ward
- [1] reply
- Tim Brownlaw
- Kirk Ward
- [1] reply
- Tim Brownlaw
- Kirk Ward
Next Topics on Trending Feed
-
17