Skip to content

Instantly share code, notes, and snippets.

@MrThiemann
Created August 18, 2020 06:45
Show Gist options
  • Save MrThiemann/d23e8f046427deaf14f48f3595172175 to your computer and use it in GitHub Desktop.
Save MrThiemann/d23e8f046427deaf14f48f3595172175 to your computer and use it in GitHub Desktop.
Printer Information
<?php if ( have_rows( 'printer_information' ) ) : ?>
<?php while ( have_rows( 'printer_information' ) ) : the_row(); ?>
<?php $vendor_3d_drucker_hersteller = get_sub_field( 'vendor_3d_drucker_hersteller' ); ?>
<?php if ( $vendor_3d_drucker_hersteller ) : ?>
<?php $get_terms_args = array(
'taxonomy' => 'hersteller',
'hide_empty' => 0,
'include' => $vendor_3d_drucker_hersteller,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
<?php if ( $terms ) : ?>
<?php foreach ( $terms as $term ) : ?>
<a href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo esc_html( $term->name ); ?></a>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php $vendor_3d_drucker_name = get_sub_field( 'vendor_3d_drucker_name' ); ?>
<?php if ( $vendor_3d_drucker_name ) : ?>
<?php foreach ( $vendor_3d_drucker_name as $post ) : ?>
<?php setup_postdata ( $post ); ?>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
<?php endforeach; ?>
<?php wp_reset_postdata(); ?>
<?php endif; ?>
<?php $vendor_3d_drucker_filament = get_sub_field( 'vendor_3d_drucker_filament' ); ?>
<?php if ( $vendor_3d_drucker_filament ) : ?>
<?php $get_terms_args = array(
'taxonomy' => 'filament',
'hide_empty' => 0,
'include' => $vendor_3d_drucker_filament,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
<?php if ( $terms ) : ?>
<?php foreach ( $terms as $term ) : ?>
<a href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo esc_html( $term->name ); ?></a>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php $vendor_druckverfahren = get_sub_field( 'vendor_druckverfahren' ); ?>
<?php if ( $vendor_druckverfahren ) : ?>
<?php $get_terms_args = array(
'taxonomy' => 'tax_verfahren',
'hide_empty' => 0,
'include' => $vendor_druckverfahren,
); ?>
<?php $terms = get_terms( $get_terms_args ); ?>
<?php if ( $terms ) : ?>
<?php foreach ( $terms as $term ) : ?>
<a href="<?php echo esc_url( get_term_link( $term ) ); ?>"><?php echo esc_html( $term->name ); ?></a>
<?php endforeach; ?>
<?php endif; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
@MrThiemann
Copy link
Author

Seb-Menu // Fieldgroup // ACF: https://ibb.co/Ldm7B5c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment