adam533
Forum Replies Created
-
That sounds like a solution that would work for me, though I don’t have the php knowledge to do it. Would you be willing to share the code if you get this working?
I am also wondering this. I have the NextGEN Custom Field Plugin installed also. My hope is to be able to include two extra text fields when the user uploads an image.
Forum: Plugins
In reply to: Different Thumbnail Size for Different GalleriesCould you share the code you used? I came here today looking for a way to solve this exact problem and have had no luck.
Thanks
Edit: Wait I just went back and changed the php code template to the previous version we used and it works now. Thank you very much for your help on solving this.
The code that works, for anybody that wants to do this themselves is:
This goes in your page template:
<?php $cft_id = get_post_meta( $post->ID, 'gallery', true ); echo apply_filters( "the_content" , "[nggallery id='{$cft_id}']" ); ?>
This goes in the PHP Code Section of Custom Field Template:
global $wpdb; $values = array(); $attachments = $wpdb->get_results('SELECT gid,title,path FROM wp_ngg_gallery'); foreach ($attachments as $attachment) { $str = '[nggallery id=' . $attachment->gid . ']'; $values[] = $str; }
This goes in the Custom Field Template Options:
[gallery] hideKey = true label = Select Gallery for this page. type = select code = 0
Thanks again for your help!
So close… ??
It is showing the correct code now:
[ngggallery id=1]
Though WordPress is wrapping that in paragraph tags, so instead of showing the gallery it is showing the code. Can I eliminate the paragraph tags?
Thank you so much for your quick help on this.
The code I am using in the PHP Code section of CFT is:
global $wpdb; $values = array(); $attachments = $wpdb->get_results('SELECT gid,title,path FROM wp_ngg_gallery'); foreach ($attachments as $attachment) { $str = '[ngggallery id=' . $attachment->gid . ']'; $values[] = $str; }
The code in my page template is what you just pasted above:
<?php $cft_id = get_post_meta( $post->ID, 'gallery', true ); echo apply_filters( "the_content" , "[ngggallery id='{$cft_id}']" ); ?>
When I do that the result I get on my page is:
[ngggallery id='[ngggallery id=1]‘]
Perfect, thank you so much!
I am also looking for a way of doing this. Did you happen to find an answer yet?
Sorry to bump an old thread but was hoping you could help me. I have used the code you supplied and it seemed to be working. When I check the page on the site though, all I see is the value that appears in the dropdown menu instead of the actual gallery. Could you possibly help me to get the actual gallery to display on the page?
I am working on a project now where this would be a huge help. I never even thought of this as an option but now that I see it is possible, I would love to get it to work.
(Hopefully you see this! ??
Forum: Fixing WordPress
In reply to: Customizing admin area using functions.php – 3 questionsI have found a solution to #1 – Force one column for the dashboard.
The following code in the functions file works
function so_screen_layout_columns( $columns ) { $columns['dashboard'] = 1; return $columns; } add_filter( 'screen_layout_columns', 'so_screen_layout_columns' ); function so_screen_layout_dashboard() { return 1; } add_filter( 'get_user_option_screen_layout_dashboard', 'so_screen_layout_dashboard' );
Forum: Fixing WordPress
In reply to: Customizing admin area using functions.php – 3 questionsThanks I have read both of those pages previously and they were a help in other areas. Unfortunately neither page references the three items I am trying to do now. I have searched Google continuous over the last day and have not found the answers which is why I thought the WordPress forums may be of help.
Just wanted to add that I am getting the exact same error. Also have both plugins installed and was coming here to post about it (glad I searched first).
Same situation – inserting as featured is fine, white screen when inserting into a post.
Forum: Fixing WordPress
In reply to: Using Custom Fields INSIDE Query Posts commandNot sure if you ever found a solution but I am looking for the exact same thing.
Forum: Plugins
In reply to: [Plugin: Custom Post Type UI] Version 0.4.1 partially working with WP3 Beta 1Now it is working – thanks so much for the quick fix!
Forum: Plugins
In reply to: [Plugin: Custom Post Type UI] Version 0.4.1 partially working with WP3 Beta 1I am running into other problems now though unfortunately. I am able to click manage post types, but I am not able to view either of the advanced options. When I click on the links nothing happens.