KennethDanielsen
Forum Replies Created
-
Forum: Plugins
In reply to: [Menu Item Custom Fields] Displaying field value in templateHi Dzikri,
Thanks a lot – I must have missed that 🙂
It’s working perfectly now – once again, thumbs up for your support!
Forum: Plugins
In reply to: [Menu Item Custom Fields] Displaying field value in templateHi Dzikri,
Awesome job, I just updated to 0.3.0 and the bug is gone! Also I dig the way you made it easier to add more fields in just one line per field.
Using the new version I seem to have some trouble printing out the fields in my custom walker, though. I’m calling the field using:
<?php get_post_meta( $item->ID, 'imageurl', true ); >',
which still gives me nothing in my template.I’ve tried outputting $item using var_dump, which doesn’t give me any of my custom fields in the object.
On a side note, it would be nice to be able to set conditions for which menu item types the field should be displayed (pages, links, categories etc.).
Thanks for your support on this plugin 🙂
Forum: Plugins
In reply to: [Menu Item Custom Fields] Displaying field value in templateHi Dzikri,
Did you see my message above?
Best Regards
Kenneth DanielsenForum: Plugins
In reply to: [Menu Item Custom Fields] Displaying field value in templateHi Dzikri,
Thanks a lot – your help is really appreciated :-).
It seems to be working as expected now! I get a weird bug though.
When adding new menu items, it adds a link at the bottom saying “Please try again”, and the menu item was not added. The bug is gone as soon as I comment out the included menu-item-custom-fields file.
I’ve uploaded a GIF here, for you to see the bug in action. My installation is in Danish, so I apologize any inconvenience.
See the GIF here: http://gfycat.com/NimbleLinearBelugawhale
Forum: Plugins
In reply to: [Menu Item Custom Fields] Displaying field value in templateHi Dzikri,
Thanks a lot for your help – I’ve added the relevant files on this repository:
https://github.com/KennethDanielsen/Menu-Item-Custom-Fields-testForum: Plugins
In reply to: [Menu Item Custom Fields] Displaying field value in templateHey Dzikri,
Thanks for your quick reply :-).
I’m not sure what I’m doing wrong though, it doesn’t seem to work. Here’s what I’ve done:
- Installed the plugin
- Called include(‘menu-item-custom-fields-image.php’);
- Created the file above copying the default example
- Changed the custom field name using ( ‘Image URL’, ‘imageurl’ )
- Put text inside my new field in Menus
- Declared the field content in my Custom_Nav_Walker:
$item_output .= '<br /><img src="' . get_post_meta( $item->ID, 'imageurl', true ) . '"/>';
Still nothing happens. When I try using var_dump I just get empty strings for each menu item. The walker ends up printing “<img src>”.
Best Regards
Kenneth Danielsen