- This topic is empty.
-
AuthorPosts
-
September 20, 2011 at 12:18 pm #87609FaberunaMember
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.
September 20, 2011 at 12:43 pm #87610chrisburtonParticipantI can’t even enter the site without being redirected.
September 20, 2011 at 12:58 pm #87612FaberunaMemberIs my site http//:www.faberunashop.com redirecting you?
September 20, 2011 at 12:59 pm #87613FaberunaMemberSorry about that. It’s been hacked. UGGG!
September 20, 2011 at 1:01 pm #87614chrisburtonParticipantAfter 20 seconds or so, yes.
September 20, 2011 at 1:02 pm #87616FaberunaMemberSorry about that. It’s been hacked. UGGG!
September 20, 2011 at 1:03 pm #87617FaberunaMemberFixed. Now, as you were saying…
September 20, 2011 at 1:15 pm #87619chrisburtonParticipantAh 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.
September 20, 2011 at 1:24 pm #87621FaberunaMemberCool. Thanks for your help and patience!
September 20, 2011 at 1:26 pm #87622FaberunaMemberThis 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.'
';
September 21, 2011 at 12:30 pm #87675FaberunaMemberIf I can just get that code to place in my functions.php, I’d be a happy little camper!
September 21, 2011 at 12:35 pm #87677chrisburtonParticipantI’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.
September 21, 2011 at 1:46 pm #87680BobMemberOk 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
the_permalink
.Perhaps try adding in that same line of code like you have on yourindex.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_title
function only echo’s awith
the_permalink
,which doesn’t wrap around the image.. Weird, but this might be a start?September 21, 2011 at 2:22 pm #87682FaberunaMemberThanks. I will give it a try. If you’d like backdoor access to my site, let me know.
September 21, 2011 at 2:29 pm #87686TheDocMemberHoly 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!
-
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.