###Fri Jan 23 16:55:08 2015 CST
-
- Register all of them
The reason I register all of my scripts in this function is simple: it helps me keep track. Sure, I could just enqueue them all in this function with conditionals, but sometimes conditionals get confusing, and I like to take advantage of the ability to enqueue in templates, because it’s simple. I could also skip the register function for the scripts I enqueue right away, but again, I do it for organization. I register them there, together, so that I know what I’ve got and I know what I’m loading on every page versus in specific places. I also tend to make notes in comments by the register function to note where I’m enqueuing, if not immediately.
<?php /* * WordPress Sample function and action * for loading scripts in themes */ // Let's hook in our function with the javascript files with the wp_enqueue_scripts hook add_action( 'wp_enqueue_scripts', 'wpcandy_load_javascript_files' ); // Register some javascript files, because we love javascript files. Enqueue a couple as well function wpcandy_load_javascript_files() { wp_register_script( 'info-caroufredsel', get_template_directory_uri() . '/js/jquery.carouFredSel-5.5.0-packed.js', array('jquery'), '5.5.0', true ); wp_register_script( 'info-carousel-instance', get_template_directory_uri() . '/js/info-carousel-instance.js', array('info-caroufredsel'), '1.0', true ); wp_register_script( 'jquery.flexslider', get_template_directory_uri().'/js/jquery.flexslider-min.js', array('jquery'), '1.7', true ); wp_register_script( 'home-page-main-flex-slider', get_template_directory_uri().'/js/home-page-main-flex-slider.js', array('jquery.flexslider'), '1.0', true ); wp_enqueue_script( 'info-carousel-instance' ); if ( is_front_page() ) { wp_enqueue_script('home-page-main-flex-slider'); } } ?>
-
the new script_loader_tag filter
- codex
- we can use it to add 'async' to our scripts
###Sat Jan 24 10:30:04 2015 CST
###Sun Jan 25 09:17:51 2015 CST
-
should our make a row of stickers instead of mixing them in?
-
our potential custom taxonomies:
- school
- state (region?)
- specialty
-
Inside the AOA should probably be a separate wp install entirely, like insidetheaoa.osteopathic.org
- that would be easier to maintain, it seems
- our 'inside the aoa' listing on the front page could be an rss feed from the blog
-
How do we create a taxonomy for a series?
- maybe the taxonomy is hierarchical (has descendants), called 'series'
###Mon Jan 26 8:33:12 2015 CST
###Tue Jan 27 10:59:57 2015 CST
-
set default sizes of media in media settings
###Wed Jan 28 11:23:42 2015 CST
-
plugin for pulling in a post with a shortcode
- possibility for pulling in a sidebar
- which could be a custom post type
- possibility for pulling in a sidebar
-
TODO we're going, i think, to need a shortcode to insert rover-don and rover-peggy into every post.
-
stackexchange: Prevent publishing the post before setting a featured image?
-
10 Awesome Shortcodes For Your WordPress Blog
- see the "Related Posts" shortcode!
###Thu Jan 29 08:59:37 2015 CST
-
modules
_social-pick-red.scss _eo-icons.scss _index.scss _section-title.scss _f-item.scss _nav.scss _section-title-hat.scss _social.scss _widget.scss ~~_site-branding.scss~~ _super.scss _inside-the-aoa.scss _sticker.scss _size.scss _border.scss _module.scss _unit.scss _content.scss _row.scss _rover.scss _spotlight.scss _story-he 9E88 ader.scss _btn.scss _comment-form.scss _cta.scss frm.scss ~~_ad.scss~~ _f-item-old.scss _grid.scss _social-pick.scss _featured.scss _front.scss _comment-link.scss ~~_icons.scss~~ _meta.scss _f-row.scss _play-hiya.scss _rail.scss _prev-next.scss _comment.scss _image.scss ~~_site-search.scss~~ _comments.scss _story-footer.scss _story-nav.scss _topics.scss _pq.scss _story.scss _bio.scss _story-meta.scss _media.scss _caption.scss _grid-play.scss _top.scss _xnav.scss _xsite-branding.scss _xsite-search.scss _button.scss
-
possible way to programmatically add don and peggy inside the loop
-
TODO so we hardcoded our ehs script into sidebar-leaderboard.php. is there a better way to do it?
- like maybe making the leaderboard a widget area and echoing the script with a filter?
- or is it not that big of a deal to hard code this js snippet?
- like maybe making the leaderboard a widget area and echoing the script with a filter?
-
- possible use in pull quotes
###Fri Jan 30 07:09:27 2015 CST
-
installed kint debugger ``` Dumping variables is easy:
d($variable) will output a styled, collapsible container with your variable information dd($variable) will do exactly as d() except halt execution of the script s($variable) will output a simple, un-styled whitespace container sd($variable) will do exactly as s() except halt execution of the script Backtrace is also easy: Kint::trace() The displayed information for each step of the trace includes the source snippet, passed arguments and the object at the time of calling We've also baked in a few functions that are WordPress specific: dump_wp_query() dump_wp() dump_post() ```
-
custom field: elit_kicker
- for adding the kicker to the post
-
How to Display WordPress Post Thumbnails with Captions
WordPress stores each image as its own post. So the Title of the Image will be the title of the post, Caption will be the excerpt of the post, and Description will be the content of the post.
// ex. <?php the_post_thumbnail(); echo get_post(get_post_thumbnail_id())->post_excerpt; ?>
###Sat Jan 31 06:53:09 2015 CST
-
TODO AP-Styleify our dates
-
4 things a browser can animate cheaply via html5rocks
- position
- scale
- rotation
- opacity
-
TODO we have a problem with double downloads using the RICG Responsive Images plugin
###Sun Feb 1 05:21:36 2015 CST
-
TODO our drop cap is not rendering correctly in firefox
-
TODO social icon vertical list breaks up in firefox around 482px wide
###Mon Feb 2 07:47:24 2015 CST
###Tue Feb 3 05:07:21 2015 CST
###Wed Feb 4 10:09:37 2015 CST
-
TODO meta box for kicker -
TODO need credit at bottom of page for standalone feature images
-
scaffolding for a meta box
/** * KICKER META BOX * */ add_action( 'load-post.php' , 'elit_kicker_meta_box_setup' ); add_action( 'load-post-new.php' , 'elit_kicker_meta_box_setup' ); function elit_kicker_meta_box_setup() { } function elit_add_kicker_meta_box() { } function elit_kicker_meta_box( $object, $box ) { } function elit_save_kicker_meta( $post_id, $post ) { } /** * END KICKER META BOX */
-
TODO refactor our meta box creations -- we're repeating tons of code!
###Thu Feb 5 09:24:18 2015 CST
###Fri Feb 6 11:10:25 2015 CST
###Mon Feb 9 18:00:33 2015 CST
-
sidebars
- http://thedo.osteopathic.org/2014/04/msucom-unthsctcom-lead-do-schools-in-u-s-news-rankings/
- http://thedo.osteopathic.org/2014/04/beyond-the-stethoscope-dos-students-excel-in-nonmedical-pursuits/ -- with photo
- http://thedo.osteopathic.org/2014/05/caring-for-lgbt-patients-a-primer/
- http://thedo.osteopathic.org/2014/05/history-essay-contest-students-interns-and-residents-can-win-up-to-5000/ -- 2 sidebars
- http://thedo.osteopathic.org/2014/06/school-of-life-learning-from-my-patients-in-a-teaching-health-center/
- http://thedo.osteopathic.org/2014/07/humble-leader-cleveland-clinic-ready-take-aoa-president/
- http://thedo.osteopathic.org/2014/08/former-aoa-president-carlo-dimarco-remembered-leader-educator/
- http://thedo.osteopathic.org/2014/10/primary-care-physicians-need-know-hpv-vaccine/
-
authors
- BY TIMOTHY BEALS, OMS IV / CONTRIBUTING WRITER
- BY LINDSAY J. ERCOLE, OMS I / CONTRIBUTING WRITER
- BY JEREMY BERGER, OMS II / CONTRIBUTING WRITER
- BY CHRISTEN D. BRUMMETT, OMS II / CONTRIBUTING WRITER
- BY JEFFREY Y. TSAI, OMS II / CONTRIBUTING WRITER
- BY JOSHUA ALEXANDER, DO, MPH/ CONTRIBUTING WRITER
- BY JANKI KAPADIA, OMS II, AND SAMEER R. SOOD, OMS II/ CONTRIBUTING WRITERS
- AOA STAFF
- THE DO STAFF
-
related-style sidebars
-
tricky
-
video
###Tue Feb 10 04:57:32 2015 CST
-
migration notes
- make sure subheads are h2
- prolly won't use all pullquotes
- see if you can shorten the ones we do use
- get used to squeezing the browser to check how things are falling
- use only one category per story
-
[Creating Custom Fields for Attachments in Wordpress] (http://net.tutsplus.com/tutorials/wordpress/creating-custom-fields-for-attachments-in-wordpress/)
###Wed Feb 11 06:00:27 2015 CST
-
use wp get attachment url over https: -- see the codex filter ref for wp_get_attacment_url
###Thu Feb 12 06:37:19 2015 CST
###Fri Feb 13 06:37:10 2015 CST
###Sat Feb 14 09:49:19 2015 CST
-
So, we can define a variable somewhere, like in functions.php, and grab it somewhere else using the
global
keyword (source). Ex.:
in functions.php
$some_var = 'foo';
in footer.php (for example)
global $some_var;
###Sun Feb 15 08:52:23 2015 CST
###Mon Feb 16 04:27:42 2015 CST
-
A Look at the WordPress HTTP API: A Practical Example of wp_remote_get
-
Unit testing our plugin with vvv
cd /Users/psinco/vagrant-local
vagrant ssh
cd /srv/www/elit/htdocs
wp scaffold plugin-tests elit-social-pick
- Note:
elit-social-pick
is the name of our plugin
- Note:
cd $(wp plugin path --dir elit-social-pick)
bash bin/install-wp-tests.sh wordpress_test root root localhost latest
- And here's how we run a test:
phpunit
-
How can I add an image upload field directly to a custom write panel?
- See also: wp_handle_sideload
###Tue Feb 17 03:55:18 2015 CST
-
How to git diff between branches:
git diff branch_1..branch_2
-
How to go back, say, 2 versions:
checkout -b temp_branch HEAD~2
###Wed Feb 18 16:02:45 2015 CST
###Thu Feb 19 13:18:15 2015 CST
###Fri Feb 20 04:16:43 2015 CST
###Sat Feb 21 06:31:02 2015 CST
###Sun Feb 22 05:37:07 2015 CST
- [Some
posts_where
filter examples]
###Mon Feb 23 06:11:39 2015 CST
###Wed Feb 25 11:58:03 2015 CST
###Thu Feb 26 08:15:41 2015 CST
- Choropleth maps
- Bubble maps
- Codepen: Positioning a Tooltip on a SVG
###Fri Feb 27 08:26:00 2015 CST
-
Enabled gzip, etc. in .htaccess on the live site.
- Is it working?
###Sat Feb 28 09:35:32 2015 CST
###Sun Mar 1 08:24:06 2015 CST
###Mon Mar 2 10:32:34 2015 CST
-
Collecting email addrs
-
How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
###Tue Mar 3 08:44:45 2015 CST
-
Social sharing link formats:
https://www.facebook.com/sharer/sharer.php?u=URL_TO_SHARE
https://twitter.com/intent/tweet?text=TWEET_TO_SHARE&url=URL_TO_SHARE&via=USERNAME_TO_SHARE
<a href="https://www.linkedin.com/shareArticle ?mini=true &url=https%3A%2F%2Fjonsuh.com%2F &title=Jonathan%20Suh &source=https%3A%2F%2Fjonsuh.com%2F &summary=Short%20summary target="_blank">Share on LinkedIn</a>
<a href="https://www.pinterest.com/pin/create/button/ ?url=https%3A%2F%2Fjonsuh.com%2F &media=https%3A%2F%2Fjonsuh.com%2Ficon.png &description=Short%20description &hashtags=web,development" target="_blank">Share on Pinterest</a>
*[Email](Quick Way to Add “Email This” Button to WordPress Posts)
<a href="mailto:?subject=<?php the_title();?>&body=<?php the_permalink() ?>" title="Send this article to a friend!">Email this</a>">
###Wed Mar 4 05:38:28 2015 CST
###Thu Mar 5 04:16:46 2015 CST
###Fri Mar 6 04:35:52 2015 CST
###Sat Mar 7 09:33:09 2015 CST
###Sun Mar 8 18:46:02 2015 CDT
-
[hashtag #unit-testing on wordcamp.tv] (http://wordpress.tv/tag/unit-testing/)
-
WP_UnitTestCase: The Hidden API
- 3 STARS
-
How to add unit testing and continuous integration to your WordPress plugin
###Mon Mar 9 05:59:30 2015 CDT
-
Grumpy Programmer's Guide to Building Testable PHP Applications
-
PDF from Google engineer: Guide: Writing Testable Code
###Wed Mar 11 09:53:01 2015 CDT
###Thu Mar 12 10:21:31 2015 CDT
-
tuts+: Object-Oriented Programming in WordPress: Building the Plugin I
-
psysh: a realtime developer console, interactive debuggger and repl for php
###Fri Mar 13 13:54:01 2015 CDT
###Mon Mar 16 17:24:05 2015 CDT
###Tue Mar 17 06:23:31 2015 CDT
###Thu Mar 19 11:20:03 2015 CDT
###Wed Mar 25 14:49:08 2015 CDT
-
how to fix the RSS feed XML error
- in wp-includes/feed-rss.php:
// this code is already there header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true); $more = 1; // new code block, directly under the one above $out = ob_get_contents(); $out = str_replace(array("\n", "\r", "\t", " "), "", $input); ob_end_clean();
###Mon Mar 30 09:12:01 2015 CDT
- github: favicon cheat sheet
###Tue Mar 31 10:19:23 2015 CDT
- This plugin gives an indication of how to see how much of a page is used by the story vs how much is used by comments. It uses jQuery offset() and height():
var display_height = parseInt( $(window).height() );
var page_height = parseInt( $(document).height() );
var comments_top = parseInt( $('#comments').offset().top );
- So when I get this:
PHP Warning: require_once(/tmp/wordpress//wp-includes/class-phpmailer.php): failed to open stream: No such file or directory in /srv/www/wordpress-develop/tests/phpunit/includes/mock-mailer.php on line 2
PHP Fatal error: require_once(): Failed opening required '/tmp/wordpress//wp-includes/class-phpmailer.php' (include_path='/usr/local/src/composer/vendor/phpunit/php-text-template:/usr/local/src/composer/vendor/phpunit/php-timer:/usr/local/src/composer/vendor/phpunit/php-file-iterator:/usr/local/src/composer/vendor/phpunit/phpunit:/usr/local/src/composer/vendor/symfony/yaml:/usr/local/src/composer/vendor/phpunit/php-invoker:.:/usr/share/php:/usr/share/pear') in /srv/www/wordpress-develop/tests/phpunit/includes/mock-mailer.php on line 2
* just re-setup our plugin unit tests (see Feb. 16 entry above)
###Fri Apr 3 08:32:47 2015 CDT
###Fri Apr 10 08:48:33 2015 CDT
-
Post transitions - these are typical statuses a new post goes through
- new -> auto-draft [ old_status -> new_status ]
- new -> inherit [ another possibility ]
- auto-draft -> draft
- ... -> ...
- draft -> publish
- new -> auto-draft [ old_status -> new_status ]
###Wed Apr 15 10:39:28 2015 CDT
- Wordpress Plugin Boilerplate
- Made by Tom McFarlin, who did the Tuts+ series on obj-oriented plugin devlopment
###Fri Apr 24 10:35:34 2015 CDT
###Mon May 11 11:20:04 2015 CDT
-
Example: NYTimes slideshow
-
Slideshow: possible libraries
###Thu May 14 17:19:56 2015 CDT
- Today we added a function in functions.php to keep our elit-slideshow from flashing on the page before it's ready
- How to prevent Flash of Unstyled Content on your websites
- We added this code:
###Mon May 18 16:59:12 2015 CDT
-
Today we added a couple new alternate templates for an article page. These have classes that use "--full-width".
- '--full-width' items span the full width of article; that means they don't use (7 last of 8) in our grid
-
We added our kicker meta box to the elit_slideshow custom post type, which we're bringing in as a plugin.
- StackExchange: Add Metabox to all custom post types
-
WPBeginner new: 12 Most Useful WordPress Custom Post Types Tutorials
###Sun Aug 2 12:40:45 2015 CDT
- Include posts from authors in the search results where either their display name or user login matches the query string Gist
###Fri Aug 28 16:42:39 2015 CDT
- Plugin: WP REST API (WP API)
###Fri Dec 18 16:32:18 2015 CST
###Thu Sep 1 11:13:05 2016 CDT
###Tue Oct 4 12:36:10 2016 CDT
###Wed Oct 5 12:47:19 2016 CDT
-
Blog: How to Create a Photo Album Gallery in WordPress without a plugin
-
Sitepoint: * Adding a Stylish Lightbox Effect to the WordPress Gallery
###Thu Oct 27 17:25:26 2016 CDT