12/11/2016 at 10:34 pm
#403233
Participant
I was able to add a custom text field that appears on the entry, but I’m having difficulty getting the field to appear on the overlay under the title.
I don’t have a child theme so I created a gridder folder with a copy of the .php card and put it wp-content/connections-templates/gridder.
I took the code with the custom ID and added it to the card, but wondered if I added it in the wrong place:
Here’s a copy of the code. Let me know if you need permissions to get into the cpanel or my website at cnsm.uaf.edu/physics/people
'style' => $atts['image_opacity'] ? array( 'opacity' => $atts['image_opacity'], 'filter' => 'alpha(opacity=' . $atts['image_opacity'] * 100 . ')' ) : array(),
)
); ?>
<?php
if ( $atts['overlay'] == 'none' ) {
?>
<span>;"></span>
<?php
} else {
?>
<?php
printf(
'<span style="background-color: %2$s;color: %3$s">',
$atts['overlay'] == 'hover' ? ' cn-gridder-overlay-hover' : ' cn-gridder-overlay-static',
$atts['background_color'],
$atts['color']
);
$entry->getNameBlock( array( 'format' => $atts['name_format'], 'link' => FALSE ) );
if ( $atts['show_title'] ) $entry->getTitleBlock();
</span>
((Here is where I entered the code))
$group = $entry->getMeta(
array(
'key' => 'pulsar\_binary\_quark', // This should match exactly the field id used when registering the custom field.
'single' => TRUE // Do not change this.
)
);
if ( ! empty( $group ) ) {
echo '<ul>';
foreach ( $group as $option ) {
printf( '<li>%1$s</li>', esc_html( $option ) );
}
echo '</ul>';
}
?>
<span></span>
<!-- END .cn-gridder-overlay -->
<?php
}
?>
</div> <!-- END .cn-gridder-thumb -->
<?php printf(
'<div class="cn-gridder-content" style="background-color: %1$s; color: %2$s;">',
$atts['background_color'],
$atts['color']
); ?>
<?php if ( $atts['overlay'] == 'none' ) : ?>
<div class="cn-gridder-name">
<?php $entry->getNameBlock( array( 'format' => $atts['name_format'], 'link' => FALSE ) ); ?>
<?php if ( $atts['show_title'] ) $entry->getTitleBlock(); ?>
</div>
<?php endif; ?>
-
This reply was modified 9 years, 8 months ago by
Steven Zahm. Reason: Fix code blocks
