Tag Info

New answers tagged

1

I think your problem lies in is_category(). This conditional check if you are on a category page, not if a post belongs to a category. To check if a post belongs to a category, you should be using has_category So your conditional statement should be <?php if (has_category('Legal Libation Columns') && has_tag('Legal Libation Columns')): ?> ...


1

If I understood correctly, you want a archive template for terms of core tag taxonomy that includes only your portfolio custom post type. The best way is to use the pre_get_posts action hook to set post_type argument of the query to 'portfolio': add_action('pre_get_posts', 'query_post_type'); function query_post_type($query) { //Limit to main query, tag ...


1

Add the following to your theme's function.php. Default values are shown below, except changing 'number' from 45 to 15. Only the changed values need to be included, so you can either leave the default values or remove/comment out those lines. For Wordpress Tag Cloud widget: function custom_tag_cloud_widget() { $args = array( 'smallest' => ...


0

Did a little bit of searching around this site and found some links that should help you achieve your goal 1) Search all posts that match a specific title - Found this nifty code on another thread here - A use case example of the above function here 2) Updating the "tags" for a specific post is fairly simple with this function: ...


1

You can use custom Permalink in setting. See bellow screenshot..


0

Put this function into your theme's function.php file. function is_tree($pid) { // $pid = The ID of the page we're looking for pages underneath global $post; $anc = get_post_ancestors( $post->ID ); foreach($anc as $ancestor) { if(is_page() && $ancestor == $pid) { return true; } } ...


0

I think you are searching for the get_tags() function. You would need to place it into the single-post.php (or single.php if your theme doesn't have a single-post.php) (to find the right template file you can always look up at Wordpress Template Hierarchy). To echo a list of tags with the aboved linked function you would need to use something like: ...


0

This is another solution I got from someone else I know where there's less of the counter in place and uses unset instead. It's just another way to achieve the same thing that I provided, but with less lines of PHP. Also, unset can be dangerous if you want to grab that variable/value somewhere else in the template so only if it fits your circumstances, then ...


0

it you're not seeing the buttons, try to call QTags._buttonsInit(); right after you call the quicktags( settings ); function. quicktags(settings); QTags._buttonsInit(); Following also works for me qt_editor = new QTags( { 'id': 'my_editor', 'buttons': 'strong,em,link' } ); QTags._buttonsInit(); Also, it seems that adding a button via QTags.addButton() ...


0

Demo plugin for JSON export: I'm not sure the RSS feed structure suits your needs, for example taxonomies and terms don't have any dates for the public date field. So here's an example how you can retrieve all the terms for a given taxonomy: /** * Plugin Name: WPSE - JSON export all terms for a given taxonomy. * Plugin URI: ...


0

First thing we need to do is create a function that will detect post views count and store it as a custom field for each post. To do this, paste the following codes in your theme’s functions.php > function wpb_set_post_views($postID) { > $count_key = 'wpb_post_views_count'; > $count = get_post_meta($postID, $count_key, true); > ...


0

Hmm, I based my example from what Gioia has already provided and the example that's on the Codex here. Also as a tip, you want to avoid using shorthand when writing PHP in WordPress if you're going to stick with WordPress' best practices, so you always want to write out the opening PHP tag. I wanted to break out of the foreach for the first tag so you can ...


0

You need to use another function to get the tags, something that returns an object or an array, like that you can manipulate it as you need. http://codex.wordpress.org/Function_Reference/get_tags <?php $my_tags = get_the_tags();?> Then where you need the first tag: <?php echo $my_tags[0]->name?> For looping the rest except the first ...



Top 50 recent answers are included