Welcome! To use this support forum, please Login or Join Today!

You are here → Home :: Forum Home :: General WordPress :: WordPress :: Thread

   

Put submenues IN a page

{name}
Rank

Total Posts: 6

Joined 2011-05-19

PM

 
Does anyone know of a plugin or shortcode that I can put a particular menu into the body of a page?

I would like to create particular menus in the WP menu builder and then drop them in a bulleted list inside of a section of the page using breeze's 1/3 column shortcode

-------------------------
| |menu|
| | |
| | |
| |___ _|
| |
| |
| |
-------------------------

Thanks much!
God Bless
Chris
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
Hi, This is a great feature request. I've committed it to the repository.

You can re-download the theme and update this file:
wp-content/themes/breeze/lib/functions/theme_functions.php

To use the shortcode:

[listmenu menu="Menu Name"]


You can also pass any of the wp_nav_menus parameters as functions:
http://codex.wordpress.org/Function_Reference/wp_nav_menu#Parameters

For example, to give the UL a custom class:

[listmenu menu="Menu Name" menu_class="check"]


Enjoy
{name}
Rank

Total Posts: 6

Joined 2011-05-19

PM

 
I will try to troubleshoot it if I can but...

Parse error: syntax error, unexpected '.' in /home/cluksha/public_html/wright/wp-content/themes/breeze/lib/functions/theme_functions.php on line 72
{name}
Rank

Total Posts: 6

Joined 2011-05-19

PM

 
I was stupid and copied over my old file w/o backing it up. (I have edited at least a dozen files myself and backed them all up - but wasn't expecting a new file to break :( )

Anyone got a copy of the wp-content/themes/breeze/lib/functions/theme_functions.php file prior to today? I really don't know php and need to get this back online quickly.

thanks

Or maybe someone can tell me what is amuck wit hthe code...

function st_navbar_fallback() {
  $topmenupages 
= array(
  
'include'../../../../../      => get_option('sthemes_topmenupages'),        [This is line 72]
  
'depth'        => 3,
  
'sort_column'  => 'menu_order',
  
'hierarchical' => true,
  
'title_li'     => __('')
  );
  
$topmenucats = array(
  
'include'../../../../../      => get_option('sthemes_topmenucats'),
  
'depth'        => 2,
  
'title_li'     => __('')
  );
  echo 
"<ul class=\"menu\">";?> 
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
Do you have Skype?
If so, add me at "simplethemes".

{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
This is the previous revision to theme_functions.php.
http://pastebin.com/YWyqF1A0
{name}
Rank

Total Posts: 6

Joined 2011-05-19

PM

 
I just added you Casey - Also thanks for all the help. I deleted the "../../../../../" and it worked. Not sure how it got there but it's gone now and it works great.

interestingly - that code was in there twice - but looking back it is not in the download. Not sure how I could have typed in that many ../ characters - on two diff lines - and not known I did it.

God Bless
Chris
{name}
Rank

Total Posts: 5

Joined 2011-07-07

PM

 
Is this avalible in Onyx? If not could it be? Thanks
{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
Yes, you can add this code to wp-content/onyx/lib/functions/theme_functions.php:

// Add Menus inside Pages/Posts
// thanks to http://www.cozmoslabs.com/2010/06/28/wp_nav_menu-shortcode/
// Syntax: [listmenu menu="Menu Name" menu_class="check"]

// Function that will return our Wordpress menu
function st_list_menu($atts, $content = null) {
 extract(shortcode_atts(array(  
  'menu'            => '', 
  'container'       => 'div', 
  'container_class' => '', 
  'container_id'    => '', 
  'menu_class'      => 'menu', 
  'menu_id'         => '',
  'echo'            => true,
  'fallback_cb'     => 'wp_page_menu',
  'before'          => '',
  'after'           => '',
  'link_before'     => '',
  'link_after'      => '',
  'depth'           => 0,
  'walker'          => '',
  'theme_location'  => ''), 
  $atts));

{name}
Rank

Total Posts: 5

Joined 2011-07-07

PM

 
Hi Casey - So I just updated to the latest version of Onyx and discovered that my listmenu shortcode no longer works. It seems to happen whether I use the menu name or id#. http://www.nativity-cincinnati.org/school/academics/

After adding the above to the end of theme_functions.php file I get this message...
Parse error: syntax error, unexpected $end in /home/nativity/public_html/wp-content/themes/onyx/lib/functions/theme_functions.php on line 319

I added the missing } and now get this message.
Fatal error: Cannot redeclare st_list_menu() (previously declared in /home/nativity/public_html/wp-content/themes/onyx/lib/functions/content_functions.php:1022) in /home/nativity/public_html/wp-content/themes/onyx/lib/functions/theme_functions.php on line 318

Any assistance would be GREATLY appreciated!

Rudy



{name}
RankRankRankRank

Total Posts: 3667

Joined 2011-04-27

PM

 
Hi Rudy,

I can confirm the error you're getting. If you'll remove the extra modifications you've just made, re-download the theme and replace the following file you should be all set:

wp-content/themes/onyx/lib/functions/content_functions.php

----

http://www.simplethemes.com/wordpress-themes/changelog/onyx
{name}
Rank

Total Posts: 5

Joined 2011-07-07

PM

 
Thanks Casey! We are back in Business!

Thanks for the speedy reply! Really appreciate it

Rudy