• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Help with my archive page Function Please!!!

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Help with my archive page Function Please!!!

This topic is: not resolved

Tagged: custom post template, filter, help, jquery

  • This topic has 3 replies, 2 voices, and was last updated 7 years ago by raindahl.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • March 23, 2016 at 3:20 am #182079
    raindahl
    Member

    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 #182088
    carasmo
    Participant

    There 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/.

    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


    Genesis Theme Customization and Help

    March 23, 2016 at 7:21 am #182090
    carasmo
    Participant

    Also see: http://www.advancedcustomfields.com/resources/taxonomy/


    Genesis Theme Customization and Help

    March 23, 2016 at 7:31 am #182094
    raindahl
    Member

    Hi there ,

    Thanks I will have a look at these resources

    Andrew

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble