Category: WordPress

  • CSS

    Force CSS changes to “live” immediately | Mark on WordPress

    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />
    
  • Search

    Site-specific Google Search:

    <form method="get" action="http://www.google.com/search">
    <input type="text"   name="q" size="25" maxlength="255" value="" /><br />
    <input type="radio" name="sitesearch" value="http://codex.wordpress.org/" checked /><a href="http://codex.wordpress.org/ title="codex.wordpress.org">WordPress Docs</a><br />
    <input type="radio" name="sitesearch" value="http://wordpress.org/support/" /><a href="http://wordpress.org/support/" title="wordpress.org/support">WordPress Forums</a><br />
    <input type="radio" name="sitesearch" value="http://wordpress.org/extend/plugins/" /><a href="http://wordpress.org/extend/plugins/" title="wordpress.org/extend/plugins">WordPress Plugins</a><br />
    <input type="radio" name="sitesearch" value="http://phpxref.ftwr.co.uk/wordpress/" /><a href="http://phpxref.ftwr.co.uk/wordpress/" title="phpxref.ftwr.co.uk/wordpress">WordPress phpxref</a><br />
    <input type="radio" name="sitesearch" value="http://php.net/" /><a href="http://php.net/" title="php.net">PHP Manual</a><br />
    <input type="radio" name="sitesearch" value="https://dev.pubmedia.us/" /><a href="Dev.Pubmedia.us" title="php.net">Dev.Pubmedia</a><br />
    <input type="submit" value="Google Search" />
    </form>
    
  • Dreamweaver, WordPress, MAMP, VirtualHostX

    VirtualHostX – Mac OS X Apache Virtual Hosting
    http://clickontyler.com/virtualhostx/

    MAMP: Mac, Apache, MySQL, PHP
    http://www.mamp.info/en/index.html

    Mac web development made easy – Bitbob
    http://bitbob.com/mac-web-development-made-easy

    Editing a WordPress theme with Dreamweaver CS5 – Part 1: Learning the basics | Adobe Developer Connection
    http://www.adobe.com/devnet/dreamweaver/articles/dw_wordpress_pt1.html

    “#2006 – MySQL server has gone away”
    ..\MAMP\bin\startMysql.sh” start up batch file. Add the option ” –max_allowed_packet=268435456″
    http://forum.mamp.info/viewtopic.php?f=2&t=14115#p28568

  • Performance

    Bottom of page testing info:

    <!-- (<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?> seconds uses <?php echo round(memory_get_peak_usage() / 1024 / 1024, 3); ?>MB peak memory -->
    

    Or:

    <!--
    (<?php echo get_num_queries(); ?> queries in <?php timer_stop(1); ?>  seconds)
    =TEMPLATE: <?php echo $GLOBALS['pagenow']; ?>
    -->
    

    Or:

    <?php echo '<p>' . get_num_queries() . ' queries in ' . timer_stop() . ' seconds uses ' . round( memory_get_peak_usage() / 1024 / 1024, 3 ) . ' MB peak memory.</p>'; ?>
    

    http://webpagetest.org

    https://developers.google.com/speed/pagespeed/insights/

  • Search CPT

    Add CPT(s) to WP search:

    function search_cpt( $query ) {
    	if ( $query->is_search ) {
    		$query->set( 'post_type', array( 'post', 'page', 'feed', 'custom_post_type1', 'custom_post_type2') );
    	}
    	return $query;
    }
    add_filter( 'the_search_query', 'search_cpt' );
    
  • Home for Dev and Code Related Posts

    With a special emphasis on WordPress and Internet audio.