Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Themes create the public (front-end) interface for a WordPress site.
5
votes
Warning/Error in Admin Panel while developing theme
So you have your code in a class, let's say it looks like this...
<?php
class WPSE82245
{
public function action_init()
{
// do stuff
}
}
Now you try to hook it into something.. …
2
votes
Accepted
different way to achive stylesheet_url
bloginfo('stylesheet_url') will always return the current theme's stylesheet. If current theme is a child theme, for example, it will return style.css relative to the child theme's root rather than th …
2
votes
Accepted
Why does WP recommend against custom favicon functionality in themes?
Probably because a thing like a favicon is not necessarily tied to the on-page design, but to the branding of a site in general.
In other words: it's not specifically part of the "display" of the sit …
6
votes
Accepted
Multiple Content Block
I would keep the primary content field and add a metabox + a secondary instance of the wp editor (using the handy wp_editor function).
Custom field values are stored in the database as LONGTEXT, so t …
1
vote
Wordpress Architecture as a CMS - Posts & Pages
There is an awesome plugin by @scribu called Posts 2 Posts. It allows you to manually associate different post types (or the same post type) with each other. I use it quite a bit for bigger CMS type …
100
votes
Accepted
Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
Okay, I've had two big projects where I've been in control of the server enough to namespace and rely on autoloading.
First up. Autoloading is awesome. Not worrying about requires is a relatively go …
0
votes
Accepted
Get most recent posts by category that aren't first overall
Well, you're going to have a lot of loops and a lot of custom WP_Query objects.
To start, create an $all_posts variable before you start the main loop on your home page. You should likely put all th …
83
votes
3
answers
29k
views
Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
Has anyone used autoloading and/or PHP namespaces within a plugin or theme?
Thoughts on using them? Any harm? Pitfalls?
Note: namespaces are PHP 5.3+ only. Assume, for this question, that you know y …
3
votes
Accepted
Replace single_template filter with what for default posts?
The answers you want are in the code. Meaning, you need to go exploring.
Your search should start with wp-includes/template-loader.php. This is the very last file WordPress includes before the them …
1
vote
How do I display a greyed out next_post_link when there is no next post
The short answer is that there's not really an easy way to do it. There is a solution, but it's sort of ugly. (see waay below.)
A Longer Answer
I'm including this here in the hopes that it's helpfu …
17
votes
4
answers
12k
views
Should Plugin Folders Include a Blank index.php File?
WordPress itself, in the wp-content folder, includes an empty PHP file which looks like this.
<?php
// Silence is golden.
?>
Should plugins include an empty file like this as well to stop folks vie …
2
votes
Accepted
Contact Form Security
You should use a nonce to protect yourself from CSRF attacks.
Even though you're not sending anything to the database, I'd suggest using some of the built in data validation functions (there is even …
1
vote
What is the best way to handle multiple calls to get_template_directory_uri() and similar fu...
I almost always define my own constants for things involving URLs (pattern 3).
The reasons:
Enqueueing does not account for child theme files. Using get_style_sheet_directory_uri will obviously …
2
votes
Resources for a complete beginner to learn to work professionally with Wordpress
The codex is a good place to start. Looking at the actual code (or via PHP xref) is going to do more for you than reading documentation IMO.
You should also sign up for wpMail.me, which contains a l …
2
votes
Accepted
Menus, but not by theme location
wp_nav_menu takes an optional argument called menu, which will fetch any menu by name, slug or ID.
If you just want post objects (or anything but the menu HTML), wp_get_nav_menus is the way to go. …