$wpdb selects wrong database

$_SERVER[‘DOCUMENT_ROOT’]; is not going to include secondsite. So all the files, including wp-config.php with the database details, are coming from the root public directory. To get the current directory, including subdirectories, use any of these: getcwd(); dirname(__FILE__); basename(__DIR__); But if your file is in a deeper folder, you can’t find the secondsite directory without specifying … Read more

How is this sliding/scrolling navigation made?

That sliding navigation is a feature built-in to the theme used by the Thinking for a Living website. If you view the source code, you can see that each panel in the slider is defined by similar code starting with: <div id=”covers” scope=”Covers”> <div class=”cover-index grid4 column page”> <div class=”cover grid3 cover-quote”> … A quick … Read more

Am I allowed to resell WordPress Premium Plugins under GPL? [closed]

Read http://www.gnu.org/licenses/gpl-3.0.html and http://www.gnu.org/philosophy/selling.html Except for one special situation, the GNU General Public License (GNU GPL) has no requirements about how much you can charge for distributing a copy of free software. You can charge nothing, a penny, a dollar, or a billion dollars…. The one exception is in the case where binaries are distributed … Read more

Deprecated error notice

The deprecated notice is pretty clear: Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead. The only place you use a user level it here: add_options_page( ‘Seach by Category Options’, ‘Search by Category’, 10, basename(__FILE__), array(‘SBC_Admin’, ‘config_page’) ); See that “10”? Don’t do that. Use a role, such as … Read more

How do I edit a plugin’s core properly?

If you look a little further down in the source of Breadcrumb Trail, you’ll notice this line: /* Apply filters to the arguments. */ $args = apply_filters( ‘breadcrumb_trail_args’, $args ); The author has made it possible for you to do exactly what you need, without editing the core file! Simply hook into the breadcrumb_trail_args filter … Read more