Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Search vs. Homepage

  • This topic is empty.
Viewing 15 posts - 16 through 30 (of 38 total)
  • Author
    Posts
  • #87609
    Faberuna
    Member

    I know the solution is probably simple but I really just want my search and category section to behave like my homepage: click on the post image and be taken to another site.

    #87610
    chrisburton
    Participant

    I can’t even enter the site without being redirected.

    #87612
    Faberuna
    Member

    Is my site http//:www.faberunashop.com redirecting you?

    #87613
    Faberuna
    Member

    Sorry about that. It’s been hacked. UGGG!

    #87614
    chrisburton
    Participant

    After 20 seconds or so, yes.

    #87616
    Faberuna
    Member

    Sorry about that. It’s been hacked. UGGG!

    #87617
    Faberuna
    Member

    Fixed. Now, as you were saying…

    #87619
    chrisburton
    Participant

    Ah ok, so I think to resolve this, you would need to add a code in your functions.php file to only allow the URL specified in your search results. @TheDoc knows more about this than I do.

    #87621
    Faberuna
    Member

    Cool. Thanks for your help and patience!

    #87622
    Faberuna
    Member

    This is the code that I added to functions.php to get the post images to redirect:

    function print_post_title() {
    global $post;
    $thePostID = $post->ID;
    $post_id = get_post($thePostID);
    $title = $post_id->post_title;
    $perm = get_permalink($post_id);
    $post_keys = array(); $post_val = array();
    $post_keys = get_post_custom_keys($thePostID);

    if (!empty($post_keys)) {
    foreach ($post_keys as $pkey) {
    if ($pkey=='url1' || $pkey=='title_url' || $pkey=='url_title') {
    $post_val = get_post_custom_values($pkey);
    }
    }
    if (empty($post_val)) {
    $link = $perm;
    } else {
    $link = $post_val[0];
    }
    } else {
    $link = $perm;
    }
    echo '

    '.$title.'

    ';
    #87675
    Faberuna
    Member

    If I can just get that code to place in my functions.php, I’d be a happy little camper!

    #87677
    chrisburton
    Participant

    I’m not entirely sure how to resolve this. I know a minimum of php and WordPress. You could try either stackoverflow.com or the WordPress forums. Hopefully someone else here can help.

    #87680
    Bob
    Member

    Ok I only quickly scanned the code you posted, no idea if I have the right thing here.. but in your index.php file, right after your

    you are calling that function you posted here above: .In your archive.php and your search.php file, there is no such line after your

    ,instead it immediately has a

    with the_permalink.Perhaps try adding in that same line of code like you have on your index.php page?

    I think this might solve it, but I’m not 100% sure.. because even though the whole image is clickable on your index.php page, the print_post_titlefunction only echo’s a

    with the_permalink,which doesn’t wrap around the image.. Weird, but this might be a start?

    #87682
    Faberuna
    Member

    Thanks. I will give it a try. If you’d like backdoor access to my site, let me know.

    #87686
    TheDoc
    Member

    Holy hell this is one heck of a thread. I think I see the problem. I’m swamped at the moment, but I’ll get back to you in a couple hours!

Viewing 15 posts - 16 through 30 (of 38 total)
  • The forum ‘CSS’ is closed to new topics and replies.