Last active
December 17, 2015 12:19
-
-
Save halfempty/5608516 to your computer and use it in GitHub Desktop.
WordPress Tag Search using jQuery. Demo and tutorial here: http://martyspellerberg.com/2011/11/creating-a-wordpress-tag-search-using-jquery/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function showalltags() { | |
$tags = get_tags(); | |
$html; | |
foreach ($tags as $tag){ | |
$tag_link = get_tag_link($tag->term_id); | |
$html .= "<a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>"; | |
$html .= "{$tag->name}</a>"; | |
} | |
echo $html; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body {background: #000; font-family: sans-serif; color: #999; font-size: 14px;} | |
a {color: #fff; text-decoration: none;} | |
a:hover {text-decoration: underline;} | |
h3 {font-size: 18px; font-weight: 300; background: #999; color: #fff; text-shadow: 0 1px 0 #666; padding: .5em 1em; margin: 0; -webkit-border-top-left-radius: 8px; -webkit-border-top-right-radius: 8px; -moz-border-radius-topleft: 8px; -moz-border-radius-topright: 8px; border-top-left-radius: 8px; border-top-right-radius: 8px;} | |
p { text-align: center;} | |
/* Taxonomies */ | |
.taxonomies {background: rgb(183,183,183); -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px; overflow: hidden; clear: both; width: 800px; margin: auto; text-align: left;} | |
.taxonomies a {color: #333;} | |
.catlist {list-style: none; margin: 0; padding: 0; overflow: hidden; list-style: none; padding: 0 .5em .5em .5em;} | |
.catlist a {display: block; float: left; width: 165px; margin: 0; padding: .25em;} | |
.taglist { padding: .25em; overflow: hidden; background: #ccc; font-size: 13px; } | |
.taglist a {display: block; float: left; -webkit-border-radius: 4px; -moz-border-radius: 4Px; border-radius: 4px; padding: 5px 10px; margin: .125em;} | |
.taglist a.selectedtag { background: #666; color: #fff; -moz-box-shadow:inset 0 0 10px rgba(0,0, 0, 0.5); -webkit-box-shadow:inset 0 0 10px rgba(0,0, 0, 0.5); box-shadow:inset 0 0 10px rgba(0,0, 0, 0.5); text-shadow: 0 1px 0 rgba(0,0, 0, 0.5);} | |
.searchcontrols { color: #000; overflow: hidden; padding-left: 1.2em; font-size: 12px; clear: both; } | |
.searchcontrols span {float: left; margin: 0; padding: .4em 0 .4em 0; margin: .5em 0; } | |
.searchcontrols span.slash {display: none;} | |
.searchcontrols a { float: left; padding: .3em .6em; margin: .5em 0;} | |
.searchcontrols a:hover {cursor: pointer;} | |
.searchcontrols a.selected {background: #666; color: #fff; -moz-box-shadow:inset 0 0 10px rgba(0,0, 0, 0.5); -webkit-box-shadow:inset 0 0 10px rgba(0,0, 0, 0.5); box-shadow:inset 0 0 10px rgba(0,0, 0, 0.5); text-shadow: 0 1px 0 rgba(0,0, 0, 0.5); border-color: #333;} | |
#any {-webkit-border-top-left-radius: 4px; -webkit-border-bottom-left-radius: 4px; -moz-border-radius-topleft: 4px; | |
-moz-border-radius-bottomleft: 4px; border-top-left-radius: 4px; border-bottom-left-radius: 4px; border-top: 1px solid #888; border-bottom: 1px solid #888; border-left: 1px solid #888; margin-left: .4em;} | |
#all {-webkit-border-top-right-radius: 4px; -webkit-border-bottom-right-radius: 4px; -moz-border-radius-topright: 4px; -moz-border-radius-bottomright: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-top: 1px solid #888; border-right: 1px solid #888; border-bottom: 1px solid #888; margin-right: .4em;} | |
a.searchtags {font-weight: 600; text-shadow: 0 1px 0 #666; padding: .6em 1.2em; margin: 0; background: #999; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#999', endColorstr='#666'); background: -webkit-gradient(linear, left top, left bottom, from(#999), to(#666)); background: -moz-linear-gradient(top, #999, #666); float: right; margin-left: 1em; -webkit-border-bottom-right-radius: 8px; -moz-border-radius-bottomright: 8px; border-bottom-right-radius: 8px; border-bottom-right-radius: 8px; color: #fff; font-size: 14px;} | |
a.searchtags:hover {cursor: pointer;} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is WordPress 4.3 and above work?