• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 514
  • Last Modified:

WordPress: php in text widgets

Hi all,

I'm using the Atahualpa theme and am trying to figure out how to create a left sidebar vertical menu of pages. I would like the default state (i.e., from the home page) to show the top level pages, and then show the sub-pages inside a given section, when the user clicks on the top link for that section. I have some PHP that does what I want, but I can't get the PHP to work inside the text widget that I've placed into the left sidebar. I've installed the PHP-exec plugin but it doesn't seem to do anything.

(Ideally, I would like the menu to open up as a show/hide accordion-style menu so that when you click on one of the top-level items, it opens up to show its sub-items, but that may be too much to ask.)

Thanks in advance for any help.
0
lauras2010
Asked:
lauras2010
1 Solution
 
lauras2010Author Commented:
I've increased the points because so far I haven't been able to find anything about this, anywhere on the internet ...
0
 
jeremyjared74Commented:
I will install it on my testing server, so I can be more precise with instructions. I will get back with you
when or if I find a solution.
0
 
lauras2010Author Commented:
Great -- thanks! Let me know what you find out (either way ...)

Laura
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
jeremyjared74Commented:
No problem, are you using Atahualpa 3.4.9, or Atahualpa 3.5.3? I don't know if it will matter, but just in case.
0
 
lauras2010Author Commented:
3.4.9
0
 
jeremyjared74Commented:
Ok I have a vertical drop-down menu widget working. I don't know if it has all the options you want. It does allow you to choose the pages, it does allow you to have child pages. You will be limited to the amount of Atahualpa set amount of widgets which is four. This means you can have four separate configurations, but they will be in different areas. First, download this widget: http://wordpress.org/extend/plugins/dropdown-menu-widget/.

Next in the Atahualpa theme options Disable all of the Widgets except the ones you want to use. If you leave the left inner to show (by selecting the pages from the check-box area), you have to place the new drop-down menu. widget in the same position inside of the Admin Widget section.

After you choose which widget position you want your menu widget from Atahualpa config area, go to the admin widget area. From there look for the Drop-Down menu widget and drag it to the widget bar position you chose from Atahualpa settings. Click the widget to bring up the settings for it. At the bottom you will notice a link to Menu Style. Click it and you will go to a settings page. Read these instructions carefully for the ability to customize your new widget drop-down page listings. Let me know how it turns out.

Sorry about the pic, I know the site is ugly, I was trying to hurry.
dropdown-menu.png
0
 
jeremyjared74Commented:
By the way, I just installed 3.5.3, it has some cool new features. You may want to check it out. It has an animated menu for one. I haven't checked them all out yet.


Here is the link: http://wordpress.bytesforall.com/?p=94
0
 
lauras2010Author Commented:
Well, just to be clear, before I do all the work to install and configure the new widget, what I am looking for is this: Just a list of top level items in the left sidebar. NOT a dropdown menu. I am looking for a list of menu items that looks like this:

=====
Home
About Us
Membership
Conferences
Education
Resources
=====

If you click on "About Us", then the list looks like this:

=====
Home
About Us
     Mission Statement
     History
     Board of Directors
     Contact Us
Membership
Conferences
Education
Resources
=====

That's all I'm looking for. Ideally, if the sub-menu could open up when you click on About Us without reloading the page, that's even better, but that might be too much to ask.

Again, I'm looking to have this all happen within the left sidebar column. I do not want a flyout menu (where the submenu items appear onmouseover in a layer to the right of the left column). And I definitely don't want a "vertical dropdown" menu (sub-items appear in a vertical list below a horizontal nav bar).

Does the dropdown-menu-widget do this? I can't afford the time to play with it if it's the wrong thing. I've had too many false starts already and I'm way behind.

Thanks very much for your help!
Laura S.
0
 
jeremyjared74Commented:
If you set the widget width to a small number it will do that. Set it to 100px or something. If you want to wait, I will be home this evening and I will try it first. I know it will work, because when I first set it up, I had it too thin and it was only two rows. If it were thinner, it would have been 1 row.
0
 
jeremyjared74Commented:
OK, here are the settings along with an image of how it works. From what I can tell, this is what you are wanting. Good Luck, and let me know if you have any more questions.
Untitled-1.jpg
plugin-settings.jpg
Sidebar-Settings.jpg
0
 
lauras2010Author Commented:
I'm offline all day today so will try to check into this tonight or tomorrow ... thanks and I'll keep you posted!

Laura
0
 
lauras2010Author Commented:
Actually I looked again, and I don't think this is quite it. I don't want a javascript-style "fly-out" menu. I just want a list that looks like this:

=====
Home
About Us
     Mission Statement
     History
     Board of Directors
     Contact Us
Membership
Conferences
Education
Resources
=====

The "About Us" items (Mission Statement, History, etc) should not be a flyout menu -- it should just be part of the list, like an indented section to indicate that it's a sub-menu. I know that it's common to have dropdown or flyout menus in WP, so I'm going to assume that this is what you have ... and I'll wait to hear back from you to see what it is exactly before going any further.

Thanks!
Laura
0
 
lauras2010Author Commented:
I rjust ead your post again and will try to put some time into this tomorrow or Monday to see if I can get it to do what I want. I'll let you know what I find out.

Thanks for all your help,
Laura
0
 
jeremyjared74Commented:
Sorry, I have been out for awhile. I don't think this is going to do what you want. I thought you wanted a fly-out sub-section. It is late for me, but Tomorrow I will try again.
0
 
lauras2010Author Commented:
Thanks but it's probably not worth your time. I tried making the column narrower as you suggested but I'm displaying a background image in that column so it truncates the image. And in general it doesn't seem to be the way to go.

I'll award you some points anyway for being nice enough to spend the time and help out.

Thanks,
Laura
0
 
Brandon LyonSenior Frontend DeveloperCommented:
FYI, it is surprisingly simple to make a widget. If you made your own you widget then you wouldn't need to place the php in a text widget. To create a widget just requires a little bit of theme editing.

This article seems pretty good at explaining the process.
http://www.lonewolfdesigns.co.uk/create-wordpress-widgets/
0
 
mjjdesignsCommented:
WordPress doesn't natively allow PHP to execute in a widget (text or otherwise).

If you need to do it, just install the ExecPHP plugin: http://wordpress.org/extend/plugins/exec-php/

Then your (working) PHP will do what you want.
0
 
Jason C. LevineNo oneCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now