engelen
  • Member for 8 years, 3 months
  • Last seen more than a week ago
Display a list of subcategories a post belongs to
0 votes

To do so, you should remove the ampersand (which is used to concatenate multiple arguments) and use parent instead of child_of, so that only subcategories (and not deeper-nested categories) are listed:...

View answer
Custom permalink structure for custom post type results in 404
0 votes

The problem with the code you've posted is that you're using the timestamp to create the permalink, and using it in add_rewrite_rule as if the timestamp was the post ID of the recipe. The p-parameter ...

View answer
posts_nav_link pulling in multiple post types
0 votes

Automatic pagination is only applied to the main query by default. Thus, the pagination is already working as it should. The problem probably lies in the way you're using InfiniteScroll. IS allows ...

View answer
De-registering a CSS file leaves it in the queue
0 votes

Most certainly! You can use wp_dequeue_style to dequeue an enqueued style. In fact, one might argue that it's better practice to only dequeue the style and not deregister it.

View answer
Multiple Author with link and image
0 votes

You can use get_the_author_meta to retrieve the username for the author of the current post in the loop. You could then use that in the image URL. <?php _e('Posted by'); ?> <a href="<?...

View answer
How to get list of posts from permalinks?
0 votes

There are several ways to achieve this, depending on the permalink structure of your posts. Assuming the post slug is part of the permalink structure, you can get the post slug from the post URL and ...

View answer
Hide H1 Title using the_title filter
Accepted answer
0 votes

Depending on the way your theme uses the_title, hooking into the the_title filter may or may not hide the title h1. What theme are you using? The the_title filter passes two arguments: the title (...

View answer
Print Post Parent Title
0 votes

You could just output the header around the title without using the $before and $after parameters: if ( get_the_title() ) { global $post; echo '<header class="entry-header"><h1 ...

View answer
List users by sum of all their posts' custom field values
Accepted answer
0 votes

You would probably be best of writing your own SQL query, for performance-reasons. Another option is to store the mileage separately in a custom field for each user. As for writing your own SQL query: ...

View answer
Spacing within the excerpt
0 votes

The function wpautop automatically converts linebreaks to paragraph tags. Assuming your CSS-styling is set up correctly, you can apply wpautop to any text with newlines and WordPress will ...

View answer
Session is not starting
-1 votes

No, there's no disadvantage to starting a session directly in your theme's functions.php. However, it's strange that starting your session on init is not working for you. Could it perhaps be that ...

View answer
1 2 3
4