Tagged: custom fields
-
AuthorPosts
-
October 31, 2014 at 1:41 pm #343987
Hello,
I am using several custom fields for some of my posts and I want to display them after content. I am also using mappress and YARPP to display more content into the entries. Also I would like to include some HR into the content.
Here is the code used to display custom fields:
`// echo the post content
echo ‘<div class=”entry-content” ‘.avia_markup_helper(array(‘context’ => ‘entry_content’,’echo’=>false)).’>’;
echo $content;
echo ‘</div>’;/* Let’s show our custom fields here */
$destino_web = get_post_meta( get_the_ID(), ‘web’, true);
$destino_telefono = get_post_meta( get_the_ID(), ‘telefono’, true);
$destino_precio = get_post_meta( get_the_ID(), ‘precio’, true);
$destino_horario = get_post_meta( get_the_ID(), ‘horario’, true);if( ! empty( $destino_web ) ) { echo ‘<p><strong>Web:</strong><a href=”‘ . $web . ‘”><?php get_the_title(); ?></a></p>’; }
if( ! empty( $destino_telefono ) ) { echo ‘<p><strong>Telefono:</strong> ‘ . $destino_telefono . ‘</p>’; }
if( ! empty( $destino_precio ) ) { echo ‘<p><strong>Precio:</strong> ‘ . $destino_precio . ‘</p>’; }
if( ! empty( $destino_horario ) ) { echo ‘<p><strong>Horario:</strong> ‘ . $destino_horario . ‘</p>’; }/* End showing our custom fields here */`
In the private content I also share the website URL and a Picture to give a better explanation.
November 3, 2014 at 7:08 am #345105Hi Kevin!
You can render Enfold HR element using
do_shortcode
, try with this:echo do_shortcode("[av_hr class='full' height='50' shadow='no-shadow' position='center' custom_border='av-border-thin' custom_width='50px' custom_border_color='' custom_margin_top='30px' custom_margin_bottom='30px' icon_select='yes' custom_icon_color='' icon='ue808' font='entypo-fontello' custom_class='']");
Regards,
JosueNovember 3, 2014 at 11:49 am #345208Hello Josue,
It doesn’t work. I added the code just after this:
echo $content;
echo ‘</div>’;November 3, 2014 at 6:24 pm #345419Hey!
Try adding this code to the Quick CSS:
.mapp-layout { border: 0 !important; } .mapp-layout:before, .yarpp-related:before, .yarpp-related:after{ content: ""; height: 1px; background: #e1e1e1; display: block; width: 110%; margin-bottom: 30px; } .yarpp-related{ margin-top: 30px; }
Cheers!
JosueNovember 4, 2014 at 10:32 am #345792Hello Josue,
Thanks, but I’m more concerned to change the order of the elements. Trying to do so, I used different combinations like adding directly the mappress and yarpp to the loop-index, but it doesn’t works and is related with the do_shortcode and template syntax:
/* Show Related Posts, the real one is <?php related_posts(); ?>, but it breaks the layout */ related_posts(); /* Show Map */ echo do_shortcode('[mashup query="current"]');
Do you know why the theme doesn’t allow the do_shortcode or others?
November 4, 2014 at 6:54 pm #346011Hi!
I don’t think the problem is in the theme to be honest, try doing the same with the default WordPress theme (Twenty Fourteen) to discard.
Regards,
JosueNovember 4, 2014 at 7:59 pm #346058Hello Josue,
You are right, now it is solved, thanks for help.
Regards,
Kevin.
-
AuthorPosts
- The topic ‘Modify loop-index.php plugin order display and custom fields’ is closed to new replies.