Set active class in a Php foeach

Have no idea what is $link->slug is it a post type property? or taxonomy? Something else? in case of something else you can use a strpos in comparing url? echo'<a href=”https://wordpress.stackexchange.com/questions/73941/. network_site_url() .”/services/’ .$mylink->slug . ‘ class=”. ($mylink->slug) . (stripos($_SERVER[“REQUEST_URI’], $mylink->slug) !== false ? ‘ active ‘:”).'” >’; in case of post use get_post_field global … Read more

why php notice is not getting ignored?

Also in wp-config.php, set the WP_DEBUG_DISPLAY constant to FALSE. Snippet from wp-includes/default-constants.php: // Add define(‘WP_DEBUG_DISPLAY’, null); to wp-config.php use the globally configured setting for // display_errors and not force errors to be displayed. Use false to force display_errors off. if ( !defined(‘WP_DEBUG_DISPLAY’) ) define( ‘WP_DEBUG_DISPLAY’, true );

ISOTOPE – Missing/Invalid Arguement Get Terms

get_categories() does not require parameters, by default it will query the post type post and the taxonomy category. However, get_terms() require a taxonomy parameter. Also, in the second function, you wrote: $categories = get_terms(); It should have been $terms = get_terms(‘your_taxonomy’);

Dynamically pull the correct email address from a match

Who should retrieve an email? The hook ‘publish_post’ is triggered when an author puiblish a post. So current user == post author. I assume you would do that: If Buddy-A publish a post and Buddy-B is logged in at the same time, than Buddy-B should retrieve an email that Buddy-A published a post (which maybe … Read more

WordPress Pages into Sections edit.php PHP hack

I need this to be done with PHP so that the user cannot set the Parent. I asked this over on WP.SE and got a promising answer: Creating new page with pre-defined parent page I haven’t got around to testing it yet, though, as the project is on hold. And I need to know how … Read more

Custom PHP-coding in MU installs

With the Apache web server, one would create a rule in the .htaccess file. I believe the equivalent in IIS7 is the web.config file. This page appears to point in the right direction. I would be more specific about where to place the file or how to construct the rule, but I have no experience … Read more

WP Login Button for current domain

<?php wp_loginout(); ?> Or <a href=”http://<?php bloginfo(‘url’); ?>/wp-login.php”>Login</a> What am I missing? http://codex.wordpress.org/Function_Reference/wp_loginout http://codex.wordpress.org/Function_Reference/bloginfo

Dropdown Menu for Query_Posts

Here’s a simple example of a PHP dropdown, hope this helps. <select name=”mydropdownlist”> <?php $options = array(‘option1’ => ‘option 1’ ‘option2’ => ‘option 2’ ‘option3’ => ‘option 3’); foreach($options as $value => $caption) { echo “<option value=\”$value\”>$caption</option>”; } ?> </select>