Home Forums General Issues Get title of value | Multiple Page Link


Get title of value | Multiple Page Link

  • I got this code:

    <?php if( get_field('auch-interessant') ): ?>
    <h4>Auch Interessant</h4>
    $values = get_field('auch-interessant');
    $title = get_the_title( $attachment_id );
    echo '<ul>';
    foreach($values as $value)	{
    echo '<li><a href="' . $value . '">' . $title . '</a></li>';}
    echo '</ul>';
    <?php endif; ?>

    I got a list of page links.
    But how can I get the page title of each link?

    With following code:
    echo '<li><a href="' . $value . '">' . $value . '</a></li>';}
    I got:
    <li><a href=""></a></li>

    But I want to get this:

    <li><a href="">Lorem Ipsum Dolor sit</a></li>

    Does anybody got an idea?

    Thank your very much,

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.