Adding a custom field to the title in single-loop 5

Posted in: Newspaper
Post count: 101

Hello,

I would like to add a custom field (made with advanced custom field plugin) to the single post loop template 5.

The title in this instance is the name of the artist, where the concert location needs to be right after the title in the same style. Currently the location is added but on a new rule.

this is the code to call the custom field: <?php echo the_field(‘concertlocatie’); ?>

This is the location where I would like the info to be added:
<header class="td-post-title">
<?php echo $td_mod_single->get_title();?>

Is there a location where I can alter/add this to be displayed correctly?
currently I get this:

but it should become this

Post count: 23312

Hi,

You can try using such a custom CSS code to display inline the title and increase the font size to be the same as the default title. This might be a workaround but notice that you should try it yourself because we cannot provide custom work.

Thanks for your understanding!

Post count: 101

I can do that, just thought it was programmable somewhere

Post count: 23312

Hello NickDeBaerdemaeker,

Provide your website URL so I can take a closer look at it.

Thanks.

Post count: 101

Hi and thank you,

it’s http://v2.enola.be/2018/08/10/deus-2/

I have currently enclosed both pieces of code in a div like so, not sure if it’s necessary though.

<div class="post-title"><?php echo $td_mod_single->get_title();?><h1 class="entry-title"><?php echo the_field('concertlocatie'); ?></h1></div>

Post count: 101

Solved it in the meantime, like so
<div class="post-title"><?php echo $td_mod_single->get_title();?><h1 class="entry-title"><?php if (empty(get_field('concertlocatie')) === false): ?><span class='location'><?php echo the_field('concertlocatie'); ?></span><?php endif; ?></h1></div>

with this css added

h1 {display: inline}

.location::before {
content: " - ";
}

so unless there’s another way around this to code it I think this works.

Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘Newspaper’ is closed to new topics and replies.