Call the title

Home Forums Calendar Products Events Calendar PRO Call the title

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #938688
    Hunter
    Moderator

    I’m trying to call the title as a link title (” href=”…”> on my single-event.php. When I use <?php echo get_the_title(); ?>, it shows the code rather than the event title.

    What else can I do to achieve this task?

    #938750
    Gustavo Bordoni
    Keymaster

    Hi Hunter Wilson,

    Thanks for coming here to the forums, I want to help you on your issue, but to do so I will need to see the full code of your <b>single-event.php</b>.

    Other than that the default HTML for a link with the post title would be:

    <a href="<?php echo get_permalink(); ?>"><?php the_title(); ?></a>
    

    My Best regards,

    #938864
    Hunter
    Moderator

    I tried what you provided and still got the code showing rather than the current event page title. The code I originally posted turned into a link, but it looks like this:

    < a href=”‘ . get_field(‘instagram’) . ‘” target=”_blank” >

    #938890
    Gustavo Bordoni
    Keymaster

    Hi Hunter,  the code you provided should be as the following:

    <?php echo '<a href="' . get_field( 'instagram' ) . '" target="_blank">'  . get_the_title() . '</a>'; ?>
    

    Check if the code above resolves your issue, if not I will help you faster if you provide me the full file, via http://codebin.org/

    My Best Regards,

    #938891
    Hunter
    Moderator

    I got an error when I tried that. Here is my paste bin code for a link: http://codebin.org/view/18b7694f

    #938896
    Gustavo Bordoni
    Keymaster

    Can you send me which error happened?

    Thanks,

    #938900
    Hunter
    Moderator

    I think I had some incorrect syntax, but no matter what I try I can’t get it to display the title. Can you provide me the revised snippet of my code you recommend I try and share it via pastebin?

    #938901
    Hunter
    Moderator

    I’m fairly familiar with PHP and my events used to be able to call the title all over my event pages, but I’m not sure what caused this to change.

    #939310
    Gustavo Bordoni
    Keymaster

    Hi Hunter,

    There you go: http://pastebin.com/N6qYmWjV

    If there is any problems again, please send me the error so I can help you debug whats happening.

    My Best Regards,

    #983705
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Call the title’ is closed to new replies.