• Googling this issue i found many articles on how to get post title to be external link, but thats not the way i want it to be done.

    I’m actually trying to “Automatically” get the post title to become the external link that is posted in the article.

    My articles consist of only External Links so I just want to have the post title appear instead of the post title and the external link (while having the post title being the external link that is in the post itself)

    I have no idea how to do this and i can’t find any online article to help me get the job done so i am asking here.

    Any help would be appreciated.

    My webpage is https://www.DeadAmerica.org so you can see what i am talking about.

    Thanks, David

Viewing 8 replies - 1 through 8 (of 8 total)
  • What you could do is edit your theme and use a custom field.
    You could then add the external link in the custom field and then use that to link to your post title.

    It’s doable, but just need a bit of coding and customizing your theme.

    How comfortable are you customizing your theme?

    Thread Starter DavidF88

    (@davidf88)

    I’ve done some theme customizing in the past. I dont think it should be too hard. ALthought im using the theme “Easel” i dont know how familiar you are with it. Its definitely got a lot more php things than Twenty Eleven had.

    But im definitely willing to give it a shot if you think you can do it too (and bare with me lol)

    Ok, let’s say you call your custom field external-link. Then something like this, in your loop should do it.

    $link=get_post_meta( $post->ID, 'external-link', true );
    
     	echo '<h2 class="post-title"><a href="'.$link.'">' . the_title(). '</a>'</h2>;

    I would try that in the index.php… Now, you’ll have to update all your blog post though. :/

    Thread Starter DavidF88

    (@davidf88)

    Well i inserted that code at the bottom of my Index.php file. It had no effect ??

    I dont know if its because im using the Easel theme though?

    You’ll need to edit what’s in your theme and stick that inside your loop.php.

    So in the theme you probably have something like this:

    <h2 class=”post-title>“><?php the_title(); ?></h2>

    You will need to replace that…

    Thread Starter DavidF88

    (@davidf88)

    Easel doesn’t have a loop.php :/

    althought i did find this in displaypost.php. Do i need to change whats in here?

    <?php

    if (!function_exists(‘easel_display_post_title’)) {
    function easel_display_post_title() {
    global $post, $wp_query;
    $get_post_title = ”;
    if ((easel_themeinfo(‘disable_page_titles’) && is_page()) || (easel_themeinfo(‘disable_post_titles’) && !is_page()) || (is_page(‘chat’) || is_page(‘forum’))) return;
    if (is_page()) {
    $post_title = “<h2 class=\”page-title\”>”;
    } else {
    $post_title = “<h2 class=\”post-title\”>”;
    }
    if (is_home() || is_search() || is_archive() && !is_page()) $post_title .= ““;
    $get_post_title .= get_the_title();
    if (!$get_post_title) $get_post_title = ‘( No Title )’;
    $post_title .= $get_post_title;
    if (is_home() || is_search() || is_archive() && !is_page()) $post_title .= “
    “;
    $post_title .= “</h2>\r\n”;
    echo apply_filters(‘easel_display_post_title’,$post_title);
    }
    }

    Hmmmm.. that theme looks like it’s doing some funky stuff.
    I’m not really sure how to go about it. I would have to download the theme and play with it.

    Thread Starter DavidF88

    (@davidf88)

    lol yeah it is. its doing a lot of wierd stuff, i find it a bit harder to modifty than twenty twelve was. :S

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Getting Post Title To Become External Link Found in Post’ is closed to new replies.