bathory
Forum Replies Created
-
It’s not part of my core skill set and my workload is too high to futz around when someone who does have it as a skill set could probably solve this dilemma in a few minutes.
Yeah that next bit is the part I really need.
I know it’s something like this…
<?php if ( is_user_logged_in() && IN THE GROUP MAGIC () ) { global $wpdb; $members = $wpdb->get_var( "SELECT groupname FROM diamint_uam_accessgroups "); MAGIC GOES HERE wp_nav_menu( array('menu' => 'Members' )); }else{ wp_nav_menu( array('menu' => 'Main Nav' )); } ?>
[Please post code snippets between backticks or use the code button.]
but that’s where I’m stuck bc PHP isn’t my strong suit!
Thanks ??
Since the link doesn’t totally explain what you need to do in this case – you need to set the attachment_id to the name of your custom field and then use the code as it’s written on that linked page.
eg.
<?php $featured_image = get_custom_field('Featured Image') ?> <?php $attachment_id = $featured_image; // attachment ID $image_attributes = wp_get_attachment_image_src( $attachment_id ); // returns an array ?> <img src="<?php echo $image_attributes[0] //inserts the image?>" width="450" height="250" >
[Please post code snippets between backticks or use the code button.]
??
Thanks for this post. I just futzed with this thing for an hour and came to the same conclusion as you – it will probably work better if I pay for it (but since I don’t know if it’s right for my project I won’t, oh well!)
cheers.