How do I reset a query that generates a list of categories with wp_list_categories? The query below builds a two column list of categories that is then displayed with the second code chunk. I’m using two of these queries (with different category include strings) in a jQuery tab to display different lists of categories. Problem […]
In the theme there is a custom post type called faq I just want to get certain post by its name (NOT by id cause no id exist). <?php query_posts(‘post_type=faq’) ?> how to get the_tile() and the_permalink() by its name?
When to use template tags and when to use get_template_part() and when to use function.php? I am confused at them. For example, if I want to show related portfolios under single portfolio, I can create a template tag named show_related_portfolios(). In contrast, I can create a file named content-related-portfolios.php, and use it like get_template_part( ‘content’, […]
Is there anyway of checking if a password protected post is visible / not visible? I want some thing that says this; If the post is password protected (that parts fine) and the correct password hasn’t been entered, then show ‘XXX’, else show ‘ZZZ’.
If I understand is_single() correctly, it’s only supposed to return true when the current “post” (in a generic sense) is a literal post (i.e., it has a post_type of post), and that it will return false when the current “post” is a page, attachment, etc. This is what the Codex says: is_single() returns true if […]
What would be the replacement for get_home_url() when using a multisite? For example, if I have one theme installed across several sites, and within the theme there are links that need to be specific to the current site. On my single install, using get_home_url(); would give me http://domain.com/, which was great, and if I moved […]
OK, this might be a duplicate, I was just unable to put my idea in proper search terms, sorry for that! Is there a built-in function or template tag to get the first n words of the content? I mean the_content(). Thanks!
I want to make minor css-changes based on the choice of the top (root) menu. What’s the proper way to handle this in WP? //edit// It’s a website (pages), no blog, and basically, the colors of some links and some images should depend of the choosen top-menu-item. Example, page-structure: * Start * Products * Prod.categ. […]
I’m having an odd issue, although I can understand why it works like this I do need to find a way around it. I have used the the request filter to modify the query for the home/index page to select for a post type other than ‘post’ The result of this is that is_home() is […]