Community Forums › Forums › Archived Forums › Design Tips and Tricks › Help with my archive page Function Please!!!
Tagged: custom post template, filter, help, jquery
- This topic has 3 replies, 2 voices, and was last updated 8 years, 8 months ago by raindahl.
-
AuthorPosts
-
March 23, 2016 at 3:20 am #182079raindahlMember
Hi there ,
I mostly come from a Front End/Design background and have built a few sites in Genesis but I am now delving into the world of making Custom Posts and pages through using a variety of tutorials and experimenting and through my surprise I have managed to get everything working apart from one thing .... my PHP and WordPress code knowledge is still not the greatest so any help would be appreciated!
On my archives page template I want each item to be able to display each Custom Field in a clickable lightbox (site link and password below)
http://www.togetherentertainments.co.uk/wedding/
Password: together1
This function only seems to display the most recent entries lightbox content!? Which means when you click on a lightbox it just shows the same content no matter which one you click on ?!
add_action('genesis_entry_content', 'display_custom_fields_archive'); function display_custom_fields_archive() { $music = get_field( 'music' ); $video = get_field( 'video' ); $set_list = get_field( 'set_list' ); $photos = get_field( 'photos' ); if ( $music || $video || $set_list || $photos ) { echo '<div class="archive_container">' ,'<div class="archive_box">' , '<a href="#fancyboxID-video" class="fancybox-inline"><i class="fa fa-video-camera"></i></a>', '<p>','<a href="#fancyboxID-set_list" class="fancybox-inline"><i class="fa fa-sticky-note"></i></a>','<p>', '<a href="#fancyboxID-photos" class="fancybox-inline"><i class="fa fa-camera"></i></a>','<p>','<a href="#fancyboxID-music" class="fancybox-inline"><i class="fa fa-headphones"></i></a>','</p>'; if ( $music ) { echo '<div style="display:none" class="fancybox-hidden"><div id="fancyboxID-music" class="hentry" style="width:460px;max-width:100%"> ','<p>' . $music . '</p>','</div>','</div>'; } if ( $video ) { echo '<div style="display:none" class="fancybox-hidden"><div id="fancyboxID-video" class="hentry" style="width:460px;max-width:100%"> ','<p>' . $video . '</p>','</div>','</div>'; } if ( $set_list ) { echo '<div style="display:none" class="fancybox-hidden"><div id="fancyboxID-set_list" class="hentry" style="width:460px;max-width:100%"> ','<p>' . $set_list . '</p>','</div>','</div>'; } if ( $photos ) { echo '<div style="display:none" class="fancybox-hidden"><div id="fancyboxID-photos" class="hentry" style="width:460px;max-width:100%"> ','<p>' . $photos . '</p>','</div>','</div>'; } echo '</div>','</div>'; } }
The Custom CPT is known as "wedding"
Thanks
Andrew Rainey
http://www.togetherentertainments.co.uk/wedding/March 23, 2016 at 7:19 am #182088carasmoParticipantThere is no foreach in there. See if you can find something similar and get help on ACF. This is not a Genesis specific issue, it's php.
http://www.advancedcustomfields.com/resources/code-examples/.
http://support.advancedcustomfields.com/forums/topic/extracting-post-object-data-from-within-a-repeater/
http://wordpress.stackexchange.com/questions/187793/using-acf-custom-field-for-custom-post-type-to-order-categories
March 23, 2016 at 7:21 am #182090carasmoParticipantMarch 23, 2016 at 7:31 am #182094raindahlMemberHi there ,
Thanks I will have a look at these resources
Andrew
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.