How can I link the images in the accordion slider to a category instead of a page?
Accordion Slider - Link to Category
4 posts from 3 voices-
Posted 2 years ago #
-
The easiest way to do this is to use a custom field on the slider page (in WP admin).
On the edit post page, add a custom field called "link" and add the category link here.
Next, open up index.php and find this code (around line 41):
<a href="<?php the_permalink(); ?>">and replace it with this:
<?php if ( get_post_meta($post->ID, 'link', true) ) { ?> <a href="<?php echo get_post_meta($post->ID, 'link', true) ?>"> <?php } else { ?> <a href="<?php the_permalink(); ?>"> <?php } ?>If the custom field exists, this link is displayed otherwise it defaults to the slide link.
Posted 2 years ago # -
Re: Newscast
How do I link the 5 accordion slider images to pages instead of posts that remain static (don't change)?
Also, I'm having a problem with the navigation bar below the header. The custom menus I create are duplicated.
Newscast:
1: Home > About > Dropdown > Fullwidth Page > Contact > About
2: Tech News > Adobe > Community > Browser > Illustrator...Mine:
1: Home > Cosmetic Dentistry > General Dentistry...
2: Home > Cosmetic Dentistry > General Dentistry...Any and all help is much appreciated! Thanks!
Adam
Posted 2 years ago # -
Hey!
The code I posted above should work - have you tried this?
You'd need to add the link to each slide or it will default to the permalink.
Regards,
JamesPosted 2 years ago #
Reply
You must log in to post.














