wordpress-starter 0.1 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +13 -0
- data/README.md +47 -4
- data/lib/wordpress-starter.rb +3 -2
- data/stylesheets/wordpress/_defaults.scss +267 -20
- data/stylesheets/wordpress/_page.scss +0 -363
- data/stylesheets/wordpress/_responsive.scss +0 -115
- data/stylesheets/wordpress/_theme.scss +0 -82
- data/stylesheets/wordpress/_typography.scss +0 -134
- data/templates/foundation/404.php +24 -0
- data/templates/{starter → foundation}/admin/README.txt +0 -0
- data/templates/{starter → foundation}/admin/assets/css/admin-style.css +0 -0
- data/templates/{starter → foundation}/admin/assets/css/colorpicker.css +0 -0
- data/templates/{starter → foundation}/admin/assets/images/1col.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/2-col-portfolio.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/2cl.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/2cr.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/3-col-portfolio.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/3cm.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/3cr.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/4-col-portfolio.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/accept.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/button_check.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/blank.gif +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_background.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_hex.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_hsb_b.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_hsb_h.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_hsb_s.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_indic.gif +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_overlay.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_rgb_b.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_rgb_g.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_rgb_r.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_select.gif +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/colorpicker_submit.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/colorpicker/select.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/dropdown-arrow.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/favicon.ico +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-add.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-backup.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-delete.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-docs.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-edit.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-home.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-info.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-notice.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-paint.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-settings.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-slider.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon-warn.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/icon_option.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/loading-bottom.gif +0 -0
- data/templates/{starter → foundation}/admin/assets/images/select.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/sign_warning.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/stop.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/toggle_tabs.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/warning.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/wrench.png +0 -0
- data/templates/{starter → foundation}/admin/assets/images/wrench16.png +0 -0
- data/templates/{starter → foundation}/admin/assets/js/ajaxupload.js +0 -0
- data/templates/{starter → foundation}/admin/assets/js/colorpicker.js +0 -0
- data/templates/{starter → foundation}/admin/assets/js/cookie.js +0 -0
- data/templates/{starter → foundation}/admin/assets/js/jquery.maskedinput-1.2.2.js +0 -0
- data/templates/{starter → foundation}/admin/assets/js/jquery.tipsy.js +0 -0
- data/templates/{starter → foundation}/admin/assets/js/of-medialibrary-uploader.js +0 -0
- data/templates/{starter → foundation}/admin/assets/js/smof.js +0 -0
- data/templates/foundation/admin/classes/class.options-machine.php +627 -0
- data/templates/{starter → foundation}/admin/front-end/options.php +0 -0
- data/templates/{starter → foundation}/admin/functions/functions.admin.php +0 -0
- data/templates/{starter → foundation}/admin/functions/functions.interface.php +0 -0
- data/templates/{starter → foundation}/admin/functions/functions.load.php +0 -0
- data/templates/foundation/admin/functions/functions.mediauploader.php +194 -0
- data/templates/foundation/admin/functions/functions.options.php +508 -0
- data/templates/{starter → foundation}/admin/functions/functions.php +0 -0
- data/templates/{starter → foundation}/admin/index.php +88 -86
- data/templates/{starter → foundation}/admin/layouts/default.css +0 -0
- data/templates/{starter → foundation}/admin/layouts/placebo.css +0 -0
- data/templates/foundation/archive.php +57 -0
- data/templates/foundation/category.php +40 -0
- data/templates/foundation/comments.php +65 -0
- data/templates/foundation/content-aside.php +26 -0
- data/templates/foundation/content-image.php +29 -0
- data/templates/foundation/content-link.php +27 -0
- data/templates/foundation/content-none.php +21 -0
- data/templates/foundation/content-page.php +24 -0
- data/templates/foundation/content-quote.php +26 -0
- data/templates/foundation/content-status.php +33 -0
- data/templates/foundation/content.php +67 -0
- data/templates/foundation/editor-style.scss +359 -0
- data/templates/foundation/footer.php +29 -0
- data/templates/foundation/functions.php +1425 -0
- data/templates/foundation/header.php +63 -0
- data/templates/foundation/ie.scss +1 -0
- data/templates/{starter → foundation}/images/bg/bg0.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg1.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg10.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg11.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg2.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg3.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg4.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg5.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg6.jpg +0 -0
- data/templates/{starter → foundation}/images/bg/bg7.jpg +0 -0
- data/templates/{starter → foundation}/images/bg/bg8.png +0 -0
- data/templates/{starter → foundation}/images/bg/bg9.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-behance-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-behance-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-behance.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-behance.svg +48 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-creativecloud-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-creativecloud-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-creativecloud.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-creativecloud.svg +48 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dribbble-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dribbble-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dribbble.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dribbble.svg +28 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dropbox-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dropbox-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dropbox.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-dropbox.svg +73 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-evernote-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-evernote-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-evernote.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-evernote.svg +62 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-facebook-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-facebook-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-facebook.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-facebook.svg +15 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-flickr-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-flickr-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-flickr.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-flickr.svg +14 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-github-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-github-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-github.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-github.svg +38 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-googleplus-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-googleplus-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-googleplus.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-googleplus.svg +52 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-icloud-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-icloud-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-icloud.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-icloud.svg +26 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-linkedin-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-linkedin-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-linkedin.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-linkedin.svg +28 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-mail-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-mail-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-mail.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-mail.svg +27 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-msn-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-msn-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-msn.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-msn.svg +44 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-pinterest-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-pinterest-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-pinterest.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-pinterest.svg +42 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rdio-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rdio-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rdio.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rdio.svg +18 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rss-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rss-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rss.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-rss.svg +18 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skitch-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skitch-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skitch.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skitch.svg +24 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skype-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skype-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skype.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-skype.svg +25 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-spotify-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-spotify-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-spotify.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-spotify.svg +38 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-stumbleupon-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-stumbleupon-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-stumbleupon.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-stumbleupon.svg +22 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-tumblr-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-tumblr-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-tumblr.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-tumblr.svg +16 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-twitter-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-twitter-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-twitter.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-twitter.svg +24 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-vimeo-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-vimeo-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-vimeo.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-vimeo.svg +20 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youtube-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youtube-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youtube.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youtube.svg +106 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youversion-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youversion-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youversion.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-youversion.svg +54 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-zerply-m.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-zerply-s.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-zerply.png +0 -0
- data/templates/foundation/images/fairhead-icons/fc-webicon-zerply.svg +20 -0
- data/templates/foundation/images/foundation/orbit/bullets.jpg +0 -0
- data/templates/foundation/images/foundation/orbit/left-arrow-small.png +0 -0
- data/templates/foundation/images/foundation/orbit/left-arrow.png +0 -0
- data/templates/foundation/images/foundation/orbit/loading.gif +0 -0
- data/templates/foundation/images/foundation/orbit/mask-black.png +0 -0
- data/templates/foundation/images/foundation/orbit/pause-black.png +0 -0
- data/templates/foundation/images/foundation/orbit/right-arrow-small.png +0 -0
- data/templates/foundation/images/foundation/orbit/right-arrow.png +0 -0
- data/templates/foundation/images/foundation/orbit/rotator-black.png +0 -0
- data/templates/foundation/images/foundation/orbit/timer-black.png +0 -0
- data/templates/foundation/index.php +19 -0
- data/templates/foundation/javascripts/app.js +38 -0
- data/templates/foundation/javascripts/foundation.min.js +77 -0
- data/templates/foundation/javascripts/jquery.foundation.accordion.js +39 -0
- data/templates/foundation/javascripts/jquery.foundation.alerts.js +20 -0
- data/templates/foundation/javascripts/jquery.foundation.buttons.js +79 -0
- data/templates/foundation/javascripts/jquery.foundation.clearing.js +480 -0
- data/templates/foundation/javascripts/jquery.foundation.forms.js +494 -0
- data/templates/foundation/javascripts/jquery.foundation.joyride.js +639 -0
- data/templates/foundation/javascripts/jquery.foundation.magellan.js +86 -0
- data/templates/foundation/javascripts/jquery.foundation.mediaQueryToggle.js +27 -0
- data/templates/foundation/javascripts/jquery.foundation.navigation.js +55 -0
- data/templates/foundation/javascripts/jquery.foundation.orbit.js +897 -0
- data/templates/foundation/javascripts/jquery.foundation.reveal.js +794 -0
- data/templates/foundation/javascripts/jquery.foundation.tabs.js +56 -0
- data/templates/foundation/javascripts/jquery.foundation.tooltips.js +193 -0
- data/templates/foundation/javascripts/jquery.foundation.topbar.js +156 -0
- data/templates/foundation/javascripts/modernizr.foundation.js +4 -0
- data/templates/foundation/languages/readme.txt +6 -0
- data/templates/foundation/license.txt +281 -0
- data/templates/foundation/loop.php +30 -0
- data/templates/foundation/manifest.rb +285 -0
- data/templates/foundation/options.php +43 -0
- data/templates/foundation/page.php +29 -0
- data/templates/foundation/print.css +1 -0
- data/templates/foundation/print.scss +1 -0
- data/templates/foundation/readme.txt +6 -0
- data/templates/foundation/sass/_app.scss +50 -0
- data/templates/foundation/sass/_settings.scss +243 -0
- data/templates/foundation/screen.scss +1 -0
- data/templates/foundation/screenshot.png +0 -0
- data/templates/foundation/search.php +31 -0
- data/templates/{starter → foundation}/search.png +0 -0
- data/templates/foundation/searchform.php +14 -0
- data/templates/foundation/sidebar.php +15 -0
- data/templates/foundation/single.php +31 -0
- data/templates/foundation/style.css +17 -0
- data/templates/foundation/stylesheets/fc-webicons.css +156 -0
- data/templates/foundation/tag.php +41 -0
- data/templates/project/404.php +24 -0
- data/templates/project/admin/README.txt +25 -0
- data/templates/project/admin/assets/css/admin-style.css +838 -0
- data/templates/project/admin/assets/css/colorpicker.css +177 -0
- data/templates/project/admin/assets/images/1col.png +0 -0
- data/templates/project/admin/assets/images/2-col-portfolio.png +0 -0
- data/templates/project/admin/assets/images/2cl.png +0 -0
- data/templates/project/admin/assets/images/2cr.png +0 -0
- data/templates/project/admin/assets/images/3-col-portfolio.png +0 -0
- data/templates/project/admin/assets/images/3cm.png +0 -0
- data/templates/project/admin/assets/images/3cr.png +0 -0
- data/templates/project/admin/assets/images/4-col-portfolio.png +0 -0
- data/templates/project/admin/assets/images/accept.png +0 -0
- data/templates/project/admin/assets/images/button_check.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/blank.gif +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_background.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_hex.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_hsb_b.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_hsb_h.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_hsb_s.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_indic.gif +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_overlay.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_rgb_b.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_rgb_g.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_rgb_r.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_select.gif +0 -0
- data/templates/project/admin/assets/images/colorpicker/colorpicker_submit.png +0 -0
- data/templates/project/admin/assets/images/colorpicker/select.png +0 -0
- data/templates/project/admin/assets/images/dropdown-arrow.png +0 -0
- data/templates/project/admin/assets/images/favicon.ico +0 -0
- data/templates/project/admin/assets/images/icon-add.png +0 -0
- data/templates/project/admin/assets/images/icon-backup.png +0 -0
- data/templates/project/admin/assets/images/icon-delete.png +0 -0
- data/templates/project/admin/assets/images/icon-docs.png +0 -0
- data/templates/project/admin/assets/images/icon-edit.png +0 -0
- data/templates/project/admin/assets/images/icon-home.png +0 -0
- data/templates/project/admin/assets/images/icon-info.png +0 -0
- data/templates/project/admin/assets/images/icon-notice.png +0 -0
- data/templates/project/admin/assets/images/icon-paint.png +0 -0
- data/templates/project/admin/assets/images/icon-settings.png +0 -0
- data/templates/project/admin/assets/images/icon-slider.png +0 -0
- data/templates/project/admin/assets/images/icon-warn.png +0 -0
- data/templates/project/admin/assets/images/icon_option.png +0 -0
- data/templates/project/admin/assets/images/loading-bottom.gif +0 -0
- data/templates/project/admin/assets/images/select.png +0 -0
- data/templates/project/admin/assets/images/sign_warning.png +0 -0
- data/templates/project/admin/assets/images/stop.png +0 -0
- data/templates/project/admin/assets/images/toggle_tabs.png +0 -0
- data/templates/project/admin/assets/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/templates/project/admin/assets/images/warning.png +0 -0
- data/templates/project/admin/assets/images/wrench.png +0 -0
- data/templates/project/admin/assets/images/wrench16.png +0 -0
- data/templates/project/admin/assets/js/ajaxupload.js +606 -0
- data/templates/project/admin/assets/js/colorpicker.js +455 -0
- data/templates/project/admin/assets/js/cookie.js +1 -0
- data/templates/project/admin/assets/js/jquery.maskedinput-1.2.2.js +252 -0
- data/templates/project/admin/assets/js/jquery.tipsy.js +241 -0
- data/templates/project/admin/assets/js/of-medialibrary-uploader.js +168 -0
- data/templates/project/admin/assets/js/smof.js +623 -0
- data/templates/{starter → project}/admin/classes/class.options-machine.php +0 -0
- data/templates/project/admin/front-end/options.php +77 -0
- data/templates/project/admin/functions/functions.admin.php +76 -0
- data/templates/project/admin/functions/functions.interface.php +232 -0
- data/templates/project/admin/functions/functions.load.php +14 -0
- data/templates/{starter → project}/admin/functions/functions.mediauploader.php +0 -0
- data/templates/project/admin/functions/functions.options.php +508 -0
- data/templates/project/admin/functions/functions.php +0 -0
- data/templates/project/admin/index.php +87 -0
- data/templates/project/admin/layouts/default.css +0 -0
- data/templates/project/admin/layouts/placebo.css +0 -0
- data/templates/project/archive.php +57 -0
- data/templates/{starter → project}/category.php +0 -0
- data/templates/project/comments.php +65 -0
- data/templates/{starter → project}/content-aside.php +0 -0
- data/templates/{starter → project}/content-image.php +0 -0
- data/templates/{starter → project}/content-link.php +0 -0
- data/templates/{starter → project}/content-none.php +0 -0
- data/templates/project/content-page.php +24 -0
- data/templates/{starter → project}/content-quote.php +0 -0
- data/templates/{starter → project}/content-status.php +0 -0
- data/templates/project/content.php +67 -0
- data/templates/{starter → project}/editor-style.scss +0 -0
- data/templates/project/footer.php +29 -0
- data/templates/project/functions.php +1233 -0
- data/templates/project/header.php +63 -0
- data/templates/project/images/bg/bg0.png +0 -0
- data/templates/project/images/bg/bg1.png +0 -0
- data/templates/project/images/bg/bg10.png +0 -0
- data/templates/project/images/bg/bg11.png +0 -0
- data/templates/project/images/bg/bg2.png +0 -0
- data/templates/project/images/bg/bg3.png +0 -0
- data/templates/project/images/bg/bg4.png +0 -0
- data/templates/project/images/bg/bg5.png +0 -0
- data/templates/project/images/bg/bg6.jpg +0 -0
- data/templates/project/images/bg/bg7.jpg +0 -0
- data/templates/project/images/bg/bg8.png +0 -0
- data/templates/project/images/bg/bg9.png +0 -0
- data/templates/project/index.php +19 -0
- data/templates/project/javascripts/app.js +6 -0
- data/templates/{starter → project/javascripts}/moderninzr.min.js +0 -0
- data/templates/project/languages/readme.txt +6 -0
- data/templates/project/license.txt +281 -0
- data/templates/{starter → project}/loop.php +0 -0
- data/templates/project/manifest.rb +131 -4
- data/templates/project/options.php +42 -0
- data/templates/project/page.php +29 -0
- data/templates/project/readme.txt +6 -1
- data/templates/project/screenshot.png +0 -0
- data/templates/project/search.php +31 -0
- data/templates/project/searchform.php +14 -0
- data/templates/project/sidebar.php +15 -0
- data/templates/project/single.php +31 -0
- data/templates/project/style.css +5 -0
- data/templates/{starter → project}/tag.php +0 -0
- data/templates/starter/404.php +42 -19
- data/templates/starter/README.md +41 -0
- data/templates/starter/archive.php +89 -49
- data/templates/starter/comments.php +43 -32
- data/templates/starter/content-page.php +12 -16
- data/templates/starter/content-single.php +59 -0
- data/templates/starter/content.php +52 -58
- data/templates/starter/footer.php +20 -22
- data/templates/starter/functions.php +60 -1156
- data/templates/starter/header.php +31 -52
- data/templates/starter/image.php +111 -0
- data/templates/starter/inc/custom-header.php +184 -0
- data/templates/starter/inc/extras.php +79 -0
- data/templates/starter/inc/template-tags.php +175 -0
- data/templates/starter/inc/theme-options/theme-options.php +306 -0
- data/templates/starter/index.php +41 -11
- data/templates/starter/javascripts/html5.js +6 -0
- data/templates/starter/javascripts/keyboard-image-navigation.js +14 -0
- data/templates/starter/javascripts/small-menu.js +39 -0
- data/templates/starter/languages/readme.txt +6 -0
- data/templates/starter/layouts/content-sidebar-sidebar.css +27 -0
- data/templates/starter/layouts/content-sidebar.css +25 -0
- data/templates/starter/layouts/sidebar-content-sidebar.css +27 -0
- data/templates/starter/layouts/sidebar-content.css +25 -0
- data/templates/starter/layouts/sidebar-sidebar-content.css +22 -0
- data/templates/starter/license.txt +281 -0
- data/templates/starter/manifest.rb +22 -110
- data/templates/starter/no-results.php +34 -0
- data/templates/starter/page.php +16 -14
- data/templates/starter/print.scss +1 -104
- data/templates/starter/rtl.css +17 -0
- data/templates/starter/screen.scss +653 -1
- data/templates/starter/screenshot.png +0 -0
- data/templates/starter/search.php +31 -21
- data/templates/starter/searchform.php +8 -9
- data/templates/starter/sidebar.php +29 -10
- data/templates/starter/single.php +24 -21
- data/templates/starter/style.css +10 -6
- metadata +401 -100
- data/templates/project/print.css +0 -4
- data/templates/starter/admin/functions/functions.options.php +0 -507
- data/templates/starter/app.js +0 -97
- data/templates/starter/options.php +0 -407
- data/templates/starter/readme.txt +0 -1
File without changes
|
@@ -0,0 +1,87 @@
|
|
1
|
+
<?php
|
2
|
+
/*
|
3
|
+
Title : SMOF
|
4
|
+
Description : Slightly Modified Options Framework
|
5
|
+
Version : 1.4.0
|
6
|
+
Author : Syamil MJ
|
7
|
+
Author URI : http://aquagraphite.com
|
8
|
+
License : WTFPL - http://sam.zoy.org/wtfpl/
|
9
|
+
Credits : Thematic Options Panel - http://wptheming.com/2010/11/thematic-options-panel-v2/
|
10
|
+
KIA Thematic Options Panel - https://github.com/helgatheviking/thematic-options-KIA
|
11
|
+
Woo Themes - http://woothemes.com/
|
12
|
+
Option Tree - http://wordpress.org/extend/plugins/option-tree/
|
13
|
+
*/
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Definitions
|
17
|
+
*
|
18
|
+
* @since 1.4.0
|
19
|
+
*/
|
20
|
+
$theme_version = '';
|
21
|
+
|
22
|
+
if ( function_exists( 'wp_get_theme' ) ) {
|
23
|
+
if ( is_child_theme() ) {
|
24
|
+
$temp_obj = wp_get_theme();
|
25
|
+
$theme_obj = wp_get_theme( $temp_obj->get( 'Template' ) );
|
26
|
+
}
|
27
|
+
else {
|
28
|
+
$theme_obj = wp_get_theme();
|
29
|
+
}
|
30
|
+
|
31
|
+
$theme_version = $theme_obj->get( 'Version' );
|
32
|
+
$theme_name = $theme_obj->get( 'Name' );
|
33
|
+
$theme_uri = $theme_obj->get( 'ThemeURI' );
|
34
|
+
$author_uri = $theme_obj->get( 'AuthorURI' );
|
35
|
+
}
|
36
|
+
else {
|
37
|
+
$theme_data = get_theme_data( TEMPLATEPATH.'/style.css' );
|
38
|
+
$theme_version = $theme_data['Version'];
|
39
|
+
$theme_name = $theme_data['Name'];
|
40
|
+
$theme_uri = $theme_data['ThemeURI'];
|
41
|
+
$author_uri = $theme_data['AuthorURI'];
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
define( 'SMOF_VERSION', '1.4.0' );
|
46
|
+
define( 'ADMIN_PATH', TEMPLATEPATH . '/admin/' );
|
47
|
+
define( 'ADMIN_DIR', get_template_directory_uri() . '/admin/' );
|
48
|
+
define( 'LAYOUT_PATH', ADMIN_PATH . '/layouts/' );
|
49
|
+
define( 'THEMENAME', $theme_name );
|
50
|
+
/* Theme version, uri, and the author uri are not completely necessary, but may be helpful in adding functionality */
|
51
|
+
define( 'THEMEVERSION', $theme_version );
|
52
|
+
define( 'THEMEURI', $theme_uri );
|
53
|
+
define( 'THEMEAUTHORURI', $author_uri );
|
54
|
+
|
55
|
+
define( 'OPTIONS', $theme_name.'_options' );
|
56
|
+
define( 'BACKUPS', $theme_name.'_backups' );
|
57
|
+
|
58
|
+
/**
|
59
|
+
* Required action filters
|
60
|
+
*
|
61
|
+
* @uses add_action()
|
62
|
+
*
|
63
|
+
* @since 1.0.0
|
64
|
+
*/
|
65
|
+
global $pagenow;
|
66
|
+
if ( is_admin() && isset( $_GET['activated'] ) && $pagenow == 'themes.php' )
|
67
|
+
add_action( 'admin_head', 'of_option_setup' );
|
68
|
+
|
69
|
+
add_action( 'admin_head', 'optionsframework_admin_message' );
|
70
|
+
add_action( 'admin_init', 'optionsframework_admin_init' );
|
71
|
+
add_action( 'admin_menu', 'optionsframework_add_admin' );
|
72
|
+
add_action( 'init', 'optionsframework_mlu_init' );
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Required Files
|
76
|
+
*
|
77
|
+
* @since 1.0.0
|
78
|
+
*/
|
79
|
+
require_once ADMIN_PATH . 'functions/functions.load.php';
|
80
|
+
require_once ADMIN_PATH . 'classes/class.options-machine.php';
|
81
|
+
|
82
|
+
/**
|
83
|
+
* AJAX Saving Options
|
84
|
+
*
|
85
|
+
* @since 1.0.0
|
86
|
+
*/
|
87
|
+
add_action( 'wp_ajax_of_ajax_post_action', 'of_ajax_callback' );
|
File without changes
|
File without changes
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* The template for displaying Archive pages.
|
4
|
+
*
|
5
|
+
* Used to display archive-type pages if nothing more specific matches a query.
|
6
|
+
* For example, puts together date-based pages if no date.php file exists.
|
7
|
+
*
|
8
|
+
* If you'd like to further customize these archive views, you may create a
|
9
|
+
* new template file for each specific one. For example, Twenty Twelve already
|
10
|
+
* has tag.php for Tag archives, category.php for Category archives, and
|
11
|
+
* author.php for Author archives.
|
12
|
+
*
|
13
|
+
* Learn more: http://codex.wordpress.org/Template_Hierarchy
|
14
|
+
*
|
15
|
+
* @category Theme
|
16
|
+
* @package [starter]
|
17
|
+
* @author [Your Name]
|
18
|
+
* @copyright 2012 [Your Name]
|
19
|
+
*/
|
20
|
+
|
21
|
+
get_header();
|
22
|
+
|
23
|
+
if ( have_posts() ):
|
24
|
+
?>
|
25
|
+
<header class="archive-header">
|
26
|
+
<h1 class="archive-title">
|
27
|
+
<?php
|
28
|
+
if ( is_day() ) :
|
29
|
+
printf( __( 'Daily Archives: %s', 'starter' ), '<span>' . get_the_date() . '</span>' );
|
30
|
+
elseif ( is_month() ) :
|
31
|
+
printf( __( 'Monthly Archives: %s', 'starter' ), '<span>' . get_the_date( _x( 'F Y', 'monthly archives date format', 'starter' ) ) . '</span>' );
|
32
|
+
elseif ( is_year() ) :
|
33
|
+
printf( __( 'Yearly Archives: %s', 'starter' ), '<span>' . get_the_date( _x( 'Y', 'yearly archives date format', 'starter' ) ) . '</span>' );
|
34
|
+
else :
|
35
|
+
_e( 'Archives', 'starter' );
|
36
|
+
endif;
|
37
|
+
?>
|
38
|
+
</h1>
|
39
|
+
</header>
|
40
|
+
<?php
|
41
|
+
/* Start the Loop */
|
42
|
+
while ( have_posts() ):
|
43
|
+
the_post();
|
44
|
+
|
45
|
+
/* Include the post format-specific template for the content. If you want to
|
46
|
+
* this in a child theme then include a file called called content-___.php
|
47
|
+
* (where ___ is the post format) and that will be used instead.
|
48
|
+
*/
|
49
|
+
get_template_part( 'content', get_post_format() );
|
50
|
+
endwhile;
|
51
|
+
|
52
|
+
do_action( 'pagination' );
|
53
|
+
else:
|
54
|
+
get_template_part( 'content', 'none' );
|
55
|
+
endif;
|
56
|
+
|
57
|
+
get_footer();
|
File without changes
|
@@ -0,0 +1,65 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* The template for displaying Comments.
|
4
|
+
*
|
5
|
+
* The area of the page that contains both current comments
|
6
|
+
* and the comment form. The actual display of comments is
|
7
|
+
* handled by a callback to starter_comment() which is
|
8
|
+
* located in the functions.php file.
|
9
|
+
*
|
10
|
+
* @category Theme
|
11
|
+
* @package [starter]
|
12
|
+
* @author [Your Name]
|
13
|
+
* @copyright 2012 [Your Name]
|
14
|
+
*/
|
15
|
+
|
16
|
+
/*
|
17
|
+
* If the current post is protected by a password and
|
18
|
+
* the visitor has not yet entered the password we will
|
19
|
+
* return early without loading the comments.
|
20
|
+
*/
|
21
|
+
if ( post_password_required() )
|
22
|
+
return;
|
23
|
+
?>
|
24
|
+
|
25
|
+
<div id="comments" class="comments-area">
|
26
|
+
|
27
|
+
<?php // You can start editing here -- including this comment! ?>
|
28
|
+
|
29
|
+
<?php if ( have_comments() ) : ?>
|
30
|
+
<h2 class="comments-title">
|
31
|
+
<?php
|
32
|
+
printf(
|
33
|
+
_n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'starter' ),
|
34
|
+
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>'
|
35
|
+
);
|
36
|
+
?>
|
37
|
+
</h2>
|
38
|
+
|
39
|
+
<ol class="commentlist">
|
40
|
+
<?php wp_list_comments( array( 'callback' => 'starter_comment', 'style' => 'ol' ) ); ?>
|
41
|
+
</ol>
|
42
|
+
|
43
|
+
<?php
|
44
|
+
if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ):
|
45
|
+
// are there comments to navigate through ?>
|
46
|
+
<nav id="comment-nav-below" class="navigation" role="navigation">
|
47
|
+
<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'starter' ); ?></h1>
|
48
|
+
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'starter' ) ); ?></div>
|
49
|
+
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'starter' ) ); ?></div>
|
50
|
+
</nav>
|
51
|
+
<?php endif; // check for comment navigation ?>
|
52
|
+
|
53
|
+
<?php
|
54
|
+
/* If there are no comments and comments are closed, let's leave a note.
|
55
|
+
* But we only want the note on posts and pages that had comments in the first place.
|
56
|
+
*/
|
57
|
+
if ( ! comments_open() && get_comments_number() ) : ?>
|
58
|
+
<p class="nocomments"><?php _e( 'Comments are closed.' , 'starter' ); ?></p>
|
59
|
+
<?php endif; ?>
|
60
|
+
|
61
|
+
<?php endif; // have_comments() ?>
|
62
|
+
|
63
|
+
<?php comment_form(); ?>
|
64
|
+
|
65
|
+
</div>
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* The template used for displaying page content in page.php
|
4
|
+
*
|
5
|
+
* @category Theme
|
6
|
+
* @package [starter]
|
7
|
+
* @author [Your Name]
|
8
|
+
* @copyright 2012 [Your Name]
|
9
|
+
*/
|
10
|
+
?>
|
11
|
+
|
12
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
13
|
+
<header class="entry-header">
|
14
|
+
<h1 class="entry-title"><?php the_title(); ?></h1>
|
15
|
+
</header>
|
16
|
+
|
17
|
+
<div class="entry-content">
|
18
|
+
<?php the_content(); ?>
|
19
|
+
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'starter' ), 'after' => '</div>' ) ); ?>
|
20
|
+
</div>
|
21
|
+
<footer class="entry-meta">
|
22
|
+
<?php edit_post_link( __( 'Edit', 'starter' ), '<span class="edit-link">', '</span>' ); ?>
|
23
|
+
</footer>
|
24
|
+
</article>
|
File without changes
|
File without changes
|
@@ -0,0 +1,67 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* The default template for displaying content. Used for both single and index/archive/search.
|
4
|
+
*
|
5
|
+
* @category Theme
|
6
|
+
* @package [starter]
|
7
|
+
* @author [Your Name]
|
8
|
+
* @copyright 2012 [Your Name]
|
9
|
+
*/
|
10
|
+
?>
|
11
|
+
|
12
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
13
|
+
<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
|
14
|
+
<div class="featured-post">
|
15
|
+
<?php _e( 'Featured post', 'starter' ); ?>
|
16
|
+
</div>
|
17
|
+
<?php endif; ?>
|
18
|
+
<header class="entry-header">
|
19
|
+
<?php the_post_thumbnail(); ?>
|
20
|
+
<?php if ( is_single() ) : ?>
|
21
|
+
<h1 class="entry-title"><?php the_title(); ?></h1>
|
22
|
+
<?php else : ?>
|
23
|
+
<h1 class="entry-title">
|
24
|
+
<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'starter' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
|
25
|
+
</h1>
|
26
|
+
<?php endif; // is_single() ?>
|
27
|
+
<?php if ( comments_open() ) : ?>
|
28
|
+
<div class="comments-link">
|
29
|
+
<?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'starter' ) . '</span>', __( '1 Reply', 'starter' ), __( '% Replies', 'starter' ) ); ?>
|
30
|
+
</div>
|
31
|
+
<?php endif; // comments_open() ?>
|
32
|
+
</header>
|
33
|
+
|
34
|
+
<?php if ( is_search() ):
|
35
|
+
// Only display Excerpts for Search ?>
|
36
|
+
<div class="entry-summary">
|
37
|
+
<?php the_excerpt(); ?>
|
38
|
+
</div>
|
39
|
+
<?php else : ?>
|
40
|
+
<div class="entry-content">
|
41
|
+
<?php the_content( __( 'Continue reading', 'starter' ) ); ?>
|
42
|
+
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'starter' ), 'after' => '</div>' ) ); ?>
|
43
|
+
</div>
|
44
|
+
<?php endif; ?>
|
45
|
+
|
46
|
+
<footer class="entry-meta clearfix">
|
47
|
+
<?php starter_entry_meta(); ?>
|
48
|
+
<?php edit_post_link( __( 'Edit', 'starter' ), '<span class="edit-link">', '</span>' ); ?>
|
49
|
+
<?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ):
|
50
|
+
// If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
|
51
|
+
<div class="author-info clearfix">
|
52
|
+
<div class="author-avatar">
|
53
|
+
<?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'starter_author_bio_avatar_size', 68 ) ); ?>
|
54
|
+
</div>
|
55
|
+
<div class="author-description">
|
56
|
+
<h2><?php printf( __( 'About %s', 'starter' ), get_the_author() ); ?></h2>
|
57
|
+
<p><?php the_author_meta( 'description' ); ?></p>
|
58
|
+
<div class="author-link">
|
59
|
+
<a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
|
60
|
+
<?php printf( __( 'View all posts by %s <span class="meta-nav">→</span>', 'starter' ), get_the_author() ); ?>
|
61
|
+
</a>
|
62
|
+
</div>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
<?php endif; ?>
|
66
|
+
</footer>
|
67
|
+
</article>
|
File without changes
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* The default template for displaying footer
|
4
|
+
*
|
5
|
+
* @category Theme
|
6
|
+
* @package [starter]
|
7
|
+
* @author [Your Name]
|
8
|
+
* @copyright 2012 [Your Name]
|
9
|
+
*/
|
10
|
+
?>
|
11
|
+
</div>
|
12
|
+
<?php get_sidebar(); ?>
|
13
|
+
</section>
|
14
|
+
</div>
|
15
|
+
<footer class="footer" role="contentinfo">
|
16
|
+
<?php do_action( 'starter_footer' ); ?>
|
17
|
+
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'starter' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'starter' ); ?>"><?php printf( __( 'Proudly powered by %s', 'starter' ), 'WordPress' ); ?></a>
|
18
|
+
</footer>
|
19
|
+
</div>
|
20
|
+
<?php
|
21
|
+
/* Always have wp_footer() just before the closing </body>
|
22
|
+
* tag of your theme, or you will break many plugins, which
|
23
|
+
* generally use this hook to reference JavaScript files.
|
24
|
+
*/
|
25
|
+
|
26
|
+
wp_footer();
|
27
|
+
?>
|
28
|
+
</body>
|
29
|
+
</html>
|
@@ -0,0 +1,1233 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* [starter] theme functions and definitions
|
4
|
+
*
|
5
|
+
* For more information on hooks, actions, and filters, see http://codex.wordpress.org/Plugin_API.
|
6
|
+
*
|
7
|
+
* @category Theme
|
8
|
+
* @package [starter]
|
9
|
+
* @author [Your Name]
|
10
|
+
* @copyright 2012 [Your Name]
|
11
|
+
*/
|
12
|
+
|
13
|
+
global $of_options, $data;
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Set the content width based on the theme's design and stylesheet.
|
17
|
+
*
|
18
|
+
* Used to set the width of images and content. Should be equal to the width the theme
|
19
|
+
* is designed for, generally via the style.css stylesheet.
|
20
|
+
*/
|
21
|
+
if ( ! isset( $content_width ) )
|
22
|
+
$content_width = 540;
|
23
|
+
|
24
|
+
/**
|
25
|
+
* Sets up theme defaults and registers support for various WordPress features.
|
26
|
+
*
|
27
|
+
* Note that this function is hooked into the after_setup_theme hook, which runs
|
28
|
+
* before the init hook. The init hook is too late for some features, such as indicating
|
29
|
+
* support post thumbnails.
|
30
|
+
*
|
31
|
+
* To override starter_setup() in a child theme, add your own starter_setup to your child theme's
|
32
|
+
* functions.php file.
|
33
|
+
*
|
34
|
+
* @uses add_theme_support() To add support for post thumbnails, automatic feed links and Post Formats.
|
35
|
+
* @uses register_nav_menus() To add support for navigation menus.
|
36
|
+
* @uses add_custom_background() To add support for a custom background.
|
37
|
+
* @uses add_editor_style() To style the visual editor.
|
38
|
+
* @uses load_theme_textdomain() For translation/localization support.
|
39
|
+
* @uses set_post_thumbnail_size() To set a custom post thumbnail size.
|
40
|
+
*
|
41
|
+
* @since [starter] 1.0
|
42
|
+
*/
|
43
|
+
function starter_setup() {
|
44
|
+
// SET THEME LANGUAGES DIRECTORY
|
45
|
+
// Theme translations can be filed in the my_theme/languages/ directory
|
46
|
+
load_theme_textdomain( 'starter', get_template_directory() . '/languages' );
|
47
|
+
|
48
|
+
// This theme styles the visual editor with editor-style.css to match the theme style.
|
49
|
+
add_editor_style( 'stylesheets/editor-style.css' );
|
50
|
+
|
51
|
+
// Adds support for rss links
|
52
|
+
add_theme_support( 'automatic-feed-links' );
|
53
|
+
|
54
|
+
// Add support for a variety of post formats (http://codex.wordpress.org/Post_Formats)
|
55
|
+
// Child Themes inherit the post formats defined by the parent theme
|
56
|
+
add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) );
|
57
|
+
|
58
|
+
// Add post thumbnails (http://codex.wordpress.org/Post_Thumbnails)
|
59
|
+
add_theme_support( 'post-thumbnails' );
|
60
|
+
set_post_thumbnail_size( 540, 230, true ); // Default Thumbnail Image
|
61
|
+
|
62
|
+
// Register wp_nav_menu() menus (http://codex.wordpress.org/Function_Reference/register_nav_menus)
|
63
|
+
register_nav_menu( 'primary', __( 'Primary menu', 'starter' ) );
|
64
|
+
|
65
|
+
/* Options Framework */
|
66
|
+
locate_template( 'options.php', true );
|
67
|
+
locate_template( 'admin/index.php', true );
|
68
|
+
|
69
|
+
do_action( 'starter_setup' );
|
70
|
+
}
|
71
|
+
|
72
|
+
add_action( 'after_setup_theme', 'starter_setup' );
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Some cleanup
|
76
|
+
*
|
77
|
+
* @since [starter] 1.0
|
78
|
+
* @return void
|
79
|
+
*/
|
80
|
+
function starter_init() {
|
81
|
+
// autolinks in comments
|
82
|
+
remove_filter( 'comment_text', 'make_clickable', 9 );
|
83
|
+
|
84
|
+
// Display the links to the general feeds: Post and Comment Feed
|
85
|
+
remove_action( 'wp_head', 'feed_links', 2 );
|
86
|
+
|
87
|
+
// Display the links to the extra feeds such as category feeds
|
88
|
+
remove_action( 'wp_head', 'feed_links_extra', 3 );
|
89
|
+
|
90
|
+
// Display the link to the Really Simple Discovery service endpoint, EditURI link
|
91
|
+
remove_action( 'wp_head', 'rsd_link' );
|
92
|
+
|
93
|
+
// Display the link to the Windows Live Writer manifest file.
|
94
|
+
remove_action( 'wp_head', 'wlwmanifest_link' );
|
95
|
+
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
|
96
|
+
|
97
|
+
// index link
|
98
|
+
remove_action( 'wp_head', 'index_rel_link' );
|
99
|
+
|
100
|
+
// prev link
|
101
|
+
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
|
102
|
+
|
103
|
+
// start link
|
104
|
+
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
|
105
|
+
|
106
|
+
// Display relational links for the posts adjacent to the current post.
|
107
|
+
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
|
108
|
+
|
109
|
+
// Display the XHTML generator that is generated on the wp_head hook, WP version
|
110
|
+
remove_action( 'wp_head', 'wp_generator' );
|
111
|
+
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
|
112
|
+
|
113
|
+
// remove jetpack open graph tags
|
114
|
+
remove_action( 'wp_head', 'jetpack_og_tags' );
|
115
|
+
|
116
|
+
add_filter( 'use_default_gallery_style', '__return_null' );
|
117
|
+
|
118
|
+
/* Custom oEmbed Providers */
|
119
|
+
|
120
|
+
// Add Soundcloud oEmbed
|
121
|
+
wp_oembed_add_provider( '#http://(www\.)?soundcloud\.com/.*#i', 'http://soundcloud.com/oembed', true );
|
122
|
+
|
123
|
+
// Add Kickstarter oEmbed
|
124
|
+
wp_oembed_add_provider( '#http://(www\.)?kickstarter\.com/projects/.*#i', 'http://www.kickstarter.com/services/oembed', true );
|
125
|
+
|
126
|
+
// Add Instagram oEmbed
|
127
|
+
wp_oembed_add_provider( '#http://(www\.)?instagr(am)?\.(am|com)/.*#i', 'http://api.instagram.com/oembed', true );
|
128
|
+
|
129
|
+
// Add Slideshare oEmbed
|
130
|
+
wp_oembed_add_provider( '#http://(www\.)?slideshare\.net/.*#i', 'http://api.embed.ly/v1/api/oembed', true );
|
131
|
+
}
|
132
|
+
|
133
|
+
add_action( 'init', 'starter_init' );
|
134
|
+
|
135
|
+
/**
|
136
|
+
* Remove the WordPress version from RSS feeds
|
137
|
+
*/
|
138
|
+
add_filter( 'the_generator', '__return_false' );
|
139
|
+
|
140
|
+
/**
|
141
|
+
* Adds custom scripts to theme header
|
142
|
+
*
|
143
|
+
* @since [starter] 1.0
|
144
|
+
* @return void
|
145
|
+
*/
|
146
|
+
function starter_enqueue_scripts() {
|
147
|
+
$theme = wp_get_theme();
|
148
|
+
$version = $theme['Version'];
|
149
|
+
|
150
|
+
wp_deregister_script( 'jquery' );
|
151
|
+
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3' );
|
152
|
+
|
153
|
+
/**
|
154
|
+
* We add some JavaScript to pages with the comment form
|
155
|
+
* to support sites with threaded comments (when in use).
|
156
|
+
*/
|
157
|
+
if ( is_singular() and comments_open() and get_option( 'thread_comments' ) ) {
|
158
|
+
wp_enqueue_script( 'comment-reply' );
|
159
|
+
}
|
160
|
+
|
161
|
+
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/javascripts/modernizr.min.js', false, '2.6.2' );
|
162
|
+
wp_enqueue_script( 'app', get_template_directory_uri() . '/javascripts/app.js', array( 'jquery' ), $version, true );
|
163
|
+
}
|
164
|
+
|
165
|
+
add_action( 'wp_enqueue_scripts', 'starter_enqueue_scripts' );
|
166
|
+
|
167
|
+
/**
|
168
|
+
* Adds custom styles to theme header
|
169
|
+
*
|
170
|
+
* @since [starter] 1.0
|
171
|
+
* @return void
|
172
|
+
*/
|
173
|
+
function starter_enqueue_styles() {
|
174
|
+
$theme = wp_get_theme();
|
175
|
+
$version = $theme['Version'];
|
176
|
+
|
177
|
+
wp_enqueue_style( 'app', get_stylesheet_uri(), false, $version, 'all' );
|
178
|
+
}
|
179
|
+
|
180
|
+
add_action( 'wp_enqueue_scripts', 'starter_enqueue_styles' );
|
181
|
+
|
182
|
+
/**
|
183
|
+
* Makes some changes to the <title> tag, by filtering the output of wp_title().
|
184
|
+
*
|
185
|
+
* If we have a site description and we're viewing the home page or a blog posts
|
186
|
+
* page (when using a static front page), then we will add the site description.
|
187
|
+
*
|
188
|
+
* If we're viewing a search result, then we're going to recreate the title entirely.
|
189
|
+
* We're going to add page numbers to all titles as well, to the middle of a search
|
190
|
+
* result title and the end of all other titles.
|
191
|
+
*
|
192
|
+
* The site title also gets added to all titles.
|
193
|
+
*
|
194
|
+
* @since [starter] 1.0
|
195
|
+
*
|
196
|
+
* @param string $title Title generated by wp_title()
|
197
|
+
* @param string $separator The separator passed to wp_title(). Base theme uses a vertical bar, "|", as a separator in header.php.
|
198
|
+
* @return string The new title, ready for the <title> tag.
|
199
|
+
*/
|
200
|
+
function starter_filter_wp_title( $title, $separator ) {
|
201
|
+
// Don't affect wp_title() calls in feeds.
|
202
|
+
if ( is_feed() or function_exists( 'get_wpseo_options' ) )
|
203
|
+
return $title;
|
204
|
+
|
205
|
+
// The $paged global variable contains the page number of a listing of posts.
|
206
|
+
// The $page global variable contains the page number of a single post that is paged.
|
207
|
+
// We'll display whichever one applies, if we're not looking at the first page.
|
208
|
+
global $paged, $page, $post;
|
209
|
+
|
210
|
+
if ( is_search() ) {
|
211
|
+
// If we're a search, let's start over:
|
212
|
+
$title = sprintf( __( 'Search results for %s', 'starter' ), '"' . get_search_query() . '"' );
|
213
|
+
// Add a page number if we're on page 2 or more:
|
214
|
+
if ( $paged >= 2 ) {
|
215
|
+
$title .= " $separator " . sprintf( __( 'Page %s', 'starter' ), $paged );
|
216
|
+
}
|
217
|
+
// Add the site name to the end:
|
218
|
+
$title .= " $separator " . get_bloginfo( 'name', 'display' );
|
219
|
+
// We're done. Let's send the new title back to wp_title():
|
220
|
+
return $title;
|
221
|
+
}
|
222
|
+
|
223
|
+
$return = array();
|
224
|
+
|
225
|
+
if ( $title != '' ) {
|
226
|
+
$return[] = str_replace( " $separator ", '', apply_filters( 'the_category', $title ) );
|
227
|
+
}
|
228
|
+
|
229
|
+
if ( is_single() ) {
|
230
|
+
if ( get_post_meta( $post->ID, 'title', true ) ) {
|
231
|
+
$return[] = stripslashes( get_post_meta( $post->ID, 'seo_title', true ) );
|
232
|
+
}
|
233
|
+
elseif ( ! in_array( $post->post_type, array( 'post', 'page', 'attachment' ) ) ) {
|
234
|
+
$post_type_obj = get_post_type_object( $post->post_type );
|
235
|
+
$return[] = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name );
|
236
|
+
}
|
237
|
+
}
|
238
|
+
|
239
|
+
// Add a page number if necessary:
|
240
|
+
if ( $paged >= 2 or $page >= 2 ) {
|
241
|
+
$return[] = sprintf( __( 'Page %s', 'starter' ), max( $paged, $page ) );
|
242
|
+
}
|
243
|
+
|
244
|
+
// Add the site name to the end:
|
245
|
+
$return[] = get_bloginfo( 'name', 'display' );
|
246
|
+
|
247
|
+
// If we have a site description and we're on the home/front page, add the description:
|
248
|
+
$site_description = get_bloginfo( 'description', 'display' );
|
249
|
+
if ( $site_description and ( is_home() or is_front_page() ) ) {
|
250
|
+
$return[] = $site_description;
|
251
|
+
}
|
252
|
+
|
253
|
+
// Return the new title to wp_title():
|
254
|
+
return implode( " $separator ", $return );
|
255
|
+
}
|
256
|
+
|
257
|
+
add_filter( 'wp_title', 'starter_filter_wp_title', 10, 3 );
|
258
|
+
|
259
|
+
/**
|
260
|
+
* Adds code to header
|
261
|
+
*
|
262
|
+
* @since [starter] 1.0
|
263
|
+
* @return string misc
|
264
|
+
*/
|
265
|
+
function starter_header() {
|
266
|
+
?>
|
267
|
+
<!-- For third-generation iPad with high-resolution Retina display: -->
|
268
|
+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png?1333401433">
|
269
|
+
<!-- For iPhone with high-resolution Retina display: -->
|
270
|
+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png?1333401433">
|
271
|
+
<!-- For first- and second-generation iPad: -->
|
272
|
+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png?1333401433">
|
273
|
+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
274
|
+
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png?1333401433">
|
275
|
+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
276
|
+
<link rel="shortcut icon" href="favicon.ico?1333401433" type="image/x-icon" />
|
277
|
+
<?php
|
278
|
+
do_action( 'starter_header' );
|
279
|
+
}
|
280
|
+
|
281
|
+
add_action( 'wp_head', 'starter_header', 10 );
|
282
|
+
|
283
|
+
/**
|
284
|
+
* Adds code to footer
|
285
|
+
*
|
286
|
+
* @since [starter] 1.0
|
287
|
+
* @return string misc
|
288
|
+
*/
|
289
|
+
function starter_footer() {}
|
290
|
+
|
291
|
+
add_action( 'wp_footer', 'starter_footer', 10 );
|
292
|
+
|
293
|
+
/**
|
294
|
+
* Defines widget areas
|
295
|
+
*
|
296
|
+
* @since [starter] 1.0
|
297
|
+
* @return void
|
298
|
+
*/
|
299
|
+
function starter_widgets_init() {
|
300
|
+
register_sidebar(
|
301
|
+
array(
|
302
|
+
'name' => __( 'Primary widget area', 'starter' ),
|
303
|
+
'id' => 'primary-widget-area',
|
304
|
+
'description' => __( '', 'starter' ),
|
305
|
+
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
|
306
|
+
'after_widget' => '</li>',
|
307
|
+
'before_title' => '<h3 class="widget-title">',
|
308
|
+
'after_title' => '</h3>',
|
309
|
+
)
|
310
|
+
);
|
311
|
+
}
|
312
|
+
|
313
|
+
add_action( 'widgets_init', 'starter_widgets_init' );
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Clean up output of stylesheet <link> tags
|
317
|
+
*
|
318
|
+
* @since [starter] 1.0
|
319
|
+
*/
|
320
|
+
function starter_clean_style_tag( $input ) {
|
321
|
+
preg_match_all( "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches );
|
322
|
+
// Only display media if it's print
|
323
|
+
$media = $matches[3][0] == 'print' ? ' media="print"' : '';
|
324
|
+
|
325
|
+
return '<link rel="stylesheet" href="' . $matches[ 2 ][ 0 ] . '"' . $media . '>' . "\n";
|
326
|
+
}
|
327
|
+
|
328
|
+
add_filter( 'style_loader_tag', 'starter_clean_style_tag' );
|
329
|
+
|
330
|
+
/**
|
331
|
+
* Remove unnecessary self-closing tags
|
332
|
+
*
|
333
|
+
* @since [starter] 1.0
|
334
|
+
*/
|
335
|
+
function starter_remove_self_closing_tags( $input ) {
|
336
|
+
return str_replace( ' />', '>', $input );
|
337
|
+
}
|
338
|
+
|
339
|
+
add_filter( 'get_avatar', 'starter_remove_self_closing_tags' ); // <img />
|
340
|
+
add_filter( 'comment_id_fields', 'starter_remove_self_closing_tags' ); // <input />
|
341
|
+
add_filter( 'post_thumbnail_html', 'starter_remove_self_closing_tags' ); // <img />
|
342
|
+
|
343
|
+
/**
|
344
|
+
* Wrap embedded media as suggested by Readability
|
345
|
+
*
|
346
|
+
* @link https://gist.github.com/965956
|
347
|
+
* @link http://www.readability.com/publishers/guidelines#publisher
|
348
|
+
* @since [starter] 1.0
|
349
|
+
*/
|
350
|
+
function starter_embed_wrap( $cache, $url, $attr = '', $post_ID = '' ) {
|
351
|
+
return '<div class="entry-content-asset">' . $cache . '</div>';
|
352
|
+
}
|
353
|
+
|
354
|
+
add_filter( 'embed_oembed_html', 'starter_embed_wrap', 10, 4 );
|
355
|
+
add_filter( 'embed_googlevideo', 'starter_embed_wrap', 10, 2 );
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Remove height/width attributes on images so they can be responsive
|
359
|
+
*
|
360
|
+
* @since [starter] 1.0
|
361
|
+
*/
|
362
|
+
function starter_remove_thumbnail_dimensions( $html, $id, $alt, $title ) {
|
363
|
+
return preg_replace(
|
364
|
+
array(
|
365
|
+
'/\s+width="\d+"/i',
|
366
|
+
'/\s+height="\d+"/i',
|
367
|
+
'/alt=""/i',
|
368
|
+
),
|
369
|
+
array(
|
370
|
+
'',
|
371
|
+
'',
|
372
|
+
'',
|
373
|
+
'alt="' . $title . '"',
|
374
|
+
),
|
375
|
+
$html
|
376
|
+
);
|
377
|
+
}
|
378
|
+
|
379
|
+
add_filter( 'post_thumbnail_html', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
380
|
+
add_filter( 'image_send_to_editor', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
381
|
+
add_filter( 'get_image_tag', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
382
|
+
add_filter( 'starter_shortcode_caption_content', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
383
|
+
|
384
|
+
/**
|
385
|
+
* Clean the output of attributes of images in editor.
|
386
|
+
*
|
387
|
+
* @link http://www.sitepoint.com/wordpress-change-img-tag-html/
|
388
|
+
* @since [starter] 1.0
|
389
|
+
*/
|
390
|
+
function starter_image_tag_class( $class, $id, $align, $size ) {
|
391
|
+
$align = 'align' . esc_attr( $align );
|
392
|
+
return $align;
|
393
|
+
}
|
394
|
+
|
395
|
+
add_filter( 'get_image_tag_class', 'starter_image_tag_class', 0, 4 );
|
396
|
+
|
397
|
+
/**
|
398
|
+
* Add thumbnail class to thumbnail links
|
399
|
+
*
|
400
|
+
* @since [starter] 1.0
|
401
|
+
*/
|
402
|
+
function starter_add_class_attachment_link( $html ) {
|
403
|
+
$postid = get_the_ID();
|
404
|
+
$html = str_replace( '<a', '<a class="thumbnail"', $html );
|
405
|
+
|
406
|
+
return $html;
|
407
|
+
}
|
408
|
+
|
409
|
+
add_filter( 'wp_get_attachment_link', 'starter_add_class_attachment_link', 10, 1 );
|
410
|
+
add_filter( 'starter_shortcode_caption_content', 'starter_add_class_attachment_link', 10, 1 );
|
411
|
+
|
412
|
+
/**
|
413
|
+
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
|
414
|
+
*
|
415
|
+
* @since [starter] 1.0
|
416
|
+
*/
|
417
|
+
function starter_enhanced_image_navigation( $url, $id ) {
|
418
|
+
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
|
419
|
+
return $url;
|
420
|
+
|
421
|
+
$image = get_post( $id );
|
422
|
+
if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
|
423
|
+
$url .= '#main';
|
424
|
+
|
425
|
+
return $url;
|
426
|
+
}
|
427
|
+
|
428
|
+
add_filter( 'attachment_link', 'starter_enhanced_image_navigation', 10, 2 );
|
429
|
+
|
430
|
+
/**
|
431
|
+
* Replace various active menu class names with "active"
|
432
|
+
* Remove the id="" on nav menu items
|
433
|
+
* Return 'menu-slug' for nav menu classes
|
434
|
+
*
|
435
|
+
* @since [starter] 1.0
|
436
|
+
*/
|
437
|
+
function starter_wp_nav_menu_class( $classes, $item ) {
|
438
|
+
$slug = sanitize_title( $item->title );
|
439
|
+
$classes = preg_replace( '/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes );
|
440
|
+
$classes = preg_replace( '/^((menu|page)[-_\w+]+)+/', '', $classes );
|
441
|
+
|
442
|
+
$classes[] = 'menu-' . $slug;
|
443
|
+
|
444
|
+
return array_filter( array_unique( $classes ), 'is_element_empty' );
|
445
|
+
}
|
446
|
+
|
447
|
+
add_filter( 'nav_menu_css_class', 'starter_wp_nav_menu_class', 10, 2 );
|
448
|
+
add_filter( 'nav_menu_item_id', '__return_null' );
|
449
|
+
|
450
|
+
/**
|
451
|
+
* Check if $element is empty
|
452
|
+
*
|
453
|
+
* @since [starter] 1.0
|
454
|
+
*/
|
455
|
+
function is_element_empty( $element ) {
|
456
|
+
$element = trim( $element );
|
457
|
+
|
458
|
+
return ( bool ) ! empty( $element );
|
459
|
+
}
|
460
|
+
|
461
|
+
/**
|
462
|
+
* Create a graceful fallback to wp_page_menu
|
463
|
+
*
|
464
|
+
* @since [starter] 1.0
|
465
|
+
*/
|
466
|
+
function starter_page_menu() {
|
467
|
+
|
468
|
+
$args = array(
|
469
|
+
'sort_column' => 'menu_order, post_title',
|
470
|
+
'menu_class' => 'nav-menu',
|
471
|
+
'include' => '',
|
472
|
+
'exclude' => '',
|
473
|
+
'echo' => true,
|
474
|
+
'show_home' => false,
|
475
|
+
'link_before' => '',
|
476
|
+
'link_after' => '',
|
477
|
+
);
|
478
|
+
|
479
|
+
wp_page_menu( $args );
|
480
|
+
}
|
481
|
+
|
482
|
+
/**
|
483
|
+
* Adds extra info to language attributes string
|
484
|
+
*
|
485
|
+
* @since [starter] 1.0
|
486
|
+
*/
|
487
|
+
function starter_language_attributes() {
|
488
|
+
$attr = array();
|
489
|
+
$output = '';
|
490
|
+
|
491
|
+
if ( function_exists( 'is_rtl' ) ) {
|
492
|
+
if ( is_rtl() == 'rtl' ) {
|
493
|
+
$attr[] = 'dir="rtl"';
|
494
|
+
}
|
495
|
+
}
|
496
|
+
|
497
|
+
$lang = get_bloginfo( 'language' );
|
498
|
+
|
499
|
+
if ( $lang and $lang !== 'en-US' ) {
|
500
|
+
$attr[] = "lang=\"$lang\"";
|
501
|
+
}
|
502
|
+
else {
|
503
|
+
$attr[] = 'lang="en"';
|
504
|
+
}
|
505
|
+
|
506
|
+
return implode( ' ', $attr );
|
507
|
+
}
|
508
|
+
|
509
|
+
add_filter( 'language_attributes', 'starter_language_attributes' );
|
510
|
+
|
511
|
+
/**
|
512
|
+
* remove the p from around imgs
|
513
|
+
*
|
514
|
+
* @link https://gist.github.com/975026
|
515
|
+
* @since [starter] 1.0
|
516
|
+
*/
|
517
|
+
function starter_filter_ptags_on_images( $content ) {
|
518
|
+
// Replace br tags inside figures
|
519
|
+
$content = preg_replace( '/(<figure .*>)?<br\s?\/?>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*/iU', '\1\2\3\4', $content );
|
520
|
+
// do a regular expression replace...
|
521
|
+
// find all p tags that have just
|
522
|
+
// <p>maybe some white space<img all stuff up to /> then maybe whitespace </p>
|
523
|
+
// replace it with just the image tag...
|
524
|
+
$content = preg_replace( '/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content );
|
525
|
+
// now pass that through and do the same for iframes...
|
526
|
+
return preg_replace( '/<p>\s*(<iframe .*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content );
|
527
|
+
}
|
528
|
+
|
529
|
+
add_filter( 'the_content', 'starter_filter_ptags_on_images' );
|
530
|
+
|
531
|
+
/**
|
532
|
+
* Adds browser detection body class
|
533
|
+
* Adds extra classes to body tag on custom taxonomies
|
534
|
+
*
|
535
|
+
* @since [starter] 1.0
|
536
|
+
*/
|
537
|
+
function starter_body_classes( $classes ) {
|
538
|
+
global $wp_query, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
|
539
|
+
|
540
|
+
if ( isset( $wp_query->query_vars['taxonomy'] ) or isset( $wp_query->query_vars['term'] ) ) {
|
541
|
+
array_push( $classes, 'custom-taxonomy-archive', 'custom-taxonomy-' . ( isset( $wp_query->query_vars[ 'taxonomy' ] ) ? get_query_var( 'taxonomy' ) : get_query_var( 'term' ) ) . '-archive' );
|
542
|
+
}
|
543
|
+
|
544
|
+
if ( $is_lynx ) $classes[] = 'lynx';
|
545
|
+
elseif ( $is_gecko ) $classes[] = 'gecko';
|
546
|
+
elseif ( $is_opera ) $classes[] = 'opera';
|
547
|
+
elseif ( $is_NS4 ) $classes[] = 'ns4';
|
548
|
+
elseif ( $is_safari ) $classes[] = 'safari';
|
549
|
+
elseif ( $is_chrome ) $classes[] = 'chrome';
|
550
|
+
elseif ( $is_IE ) $classes[] = 'ie';
|
551
|
+
else $classes[] = 'unknown';
|
552
|
+
|
553
|
+
if ( $is_iphone ) $classes[] = 'iphone';
|
554
|
+
|
555
|
+
// Add post/page slug
|
556
|
+
if ( is_single() or is_page() and ! is_front_page() ) {
|
557
|
+
$classes[] = basename( get_permalink() );
|
558
|
+
}
|
559
|
+
|
560
|
+
// Remove unnecessary classes
|
561
|
+
$home_id_class = 'page-id-' . get_option( 'page_on_front' );
|
562
|
+
$remove_classes = array(
|
563
|
+
'page-template-default',
|
564
|
+
$home_id_class,
|
565
|
+
);
|
566
|
+
|
567
|
+
$classes = array_diff( $classes, $remove_classes );
|
568
|
+
|
569
|
+
return $classes;
|
570
|
+
}
|
571
|
+
|
572
|
+
add_filter( 'body_class', 'starter_body_classes' );
|
573
|
+
|
574
|
+
/**
|
575
|
+
* Modifies output of custom post formats.
|
576
|
+
*
|
577
|
+
* @since [starter] 1.0
|
578
|
+
*/
|
579
|
+
function starter_custom_content( $content ) {
|
580
|
+
/* Check if we're displaying a 'quote' post. */
|
581
|
+
if ( has_post_format( 'quote' ) ) {
|
582
|
+
/* Match any <blockquote> elements. */
|
583
|
+
preg_match( '/<blockquote.*?>/', $content, $matches );
|
584
|
+
|
585
|
+
/* If no <blockquote> elements were found, wrap the entire content in one. */
|
586
|
+
if ( empty( $matches ) ) {
|
587
|
+
$content = "<blockquote>{$content}</blockquote>";
|
588
|
+
}
|
589
|
+
}
|
590
|
+
elseif ( has_post_format( 'aside' ) and ! is_singular() ) {
|
591
|
+
preg_match( '/<p>(.*?)<\/p>(?!\s*<p>)/', $content, $matches );
|
592
|
+
|
593
|
+
$content = str_replace( $matches[1], $matches[1] . ' <a href="' . get_permalink() . '">∞</a>', $content );
|
594
|
+
}
|
595
|
+
|
596
|
+
return $content;
|
597
|
+
}
|
598
|
+
|
599
|
+
add_filter( 'the_content', 'starter_custom_content' );
|
600
|
+
|
601
|
+
/**
|
602
|
+
* Remove <p> and <br /> in the shortcodes
|
603
|
+
*
|
604
|
+
* @since [starter] 1.0
|
605
|
+
*/
|
606
|
+
function starter_shortcode_empty_paragraph_fix( $content ) {
|
607
|
+
$array = array(
|
608
|
+
'<p>[' => '[',
|
609
|
+
']</p>' => ']',
|
610
|
+
']<br />' => ']',
|
611
|
+
);
|
612
|
+
|
613
|
+
// replace the strings in the $content
|
614
|
+
$content = strtr( $content, $array );
|
615
|
+
|
616
|
+
return $content;
|
617
|
+
}
|
618
|
+
|
619
|
+
add_filter( 'the_content', 'starter_shortcode_empty_paragraph_fix' );
|
620
|
+
|
621
|
+
/**
|
622
|
+
* Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
|
623
|
+
*
|
624
|
+
* Create your own starter_entry_meta() to override in a child theme.
|
625
|
+
*
|
626
|
+
* @since [starter] 1.0
|
627
|
+
*/
|
628
|
+
function starter_entry_meta() {
|
629
|
+
// Translators: used between list items, there is a space after the comma.
|
630
|
+
$categories_list = get_the_category_list( __( ', ', 'starter' ) );
|
631
|
+
|
632
|
+
// Translators: used between list items, there is a space after the comma.
|
633
|
+
$tag_list = get_the_tag_list( '', __( ', ', 'starter' ) );
|
634
|
+
|
635
|
+
$date = sprintf(
|
636
|
+
'<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a>',
|
637
|
+
esc_url( get_permalink() ),
|
638
|
+
esc_attr( get_the_time() ),
|
639
|
+
esc_attr( get_the_date( 'c' ) ),
|
640
|
+
esc_html( get_the_date() )
|
641
|
+
);
|
642
|
+
|
643
|
+
$author = sprintf(
|
644
|
+
'<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
|
645
|
+
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
646
|
+
esc_attr( sprintf( __( 'View all posts by %s', 'starter' ), get_the_author() ) ),
|
647
|
+
get_the_author()
|
648
|
+
);
|
649
|
+
|
650
|
+
// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
|
651
|
+
if ( $tag_list ) {
|
652
|
+
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'starter' );
|
653
|
+
}
|
654
|
+
elseif ( $categories_list ) {
|
655
|
+
$utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'starter' );
|
656
|
+
}
|
657
|
+
else {
|
658
|
+
$utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'starter' );
|
659
|
+
}
|
660
|
+
|
661
|
+
printf(
|
662
|
+
$utility_text,
|
663
|
+
$categories_list,
|
664
|
+
$tag_list,
|
665
|
+
$date,
|
666
|
+
$author
|
667
|
+
);
|
668
|
+
}
|
669
|
+
|
670
|
+
/**
|
671
|
+
* Returns a "Continue Reading" link for excerpts
|
672
|
+
*
|
673
|
+
* @since [starter] 1.0
|
674
|
+
*/
|
675
|
+
function starter_continue_reading_link() {
|
676
|
+
$read_more_link = ' <a href="' . get_permalink() . '" class="more-link">' . __( 'Continue reading', 'starter' ) . '</a>';
|
677
|
+
|
678
|
+
return $read_more_link;
|
679
|
+
}
|
680
|
+
|
681
|
+
/**
|
682
|
+
* Replaces "[...]" (appended to automatically generated excerpts ) with starter_continue_reading_link().
|
683
|
+
*
|
684
|
+
* To override this in a child theme, remove the filter and add your own
|
685
|
+
* function tied to the excerpt_more filter hook.
|
686
|
+
*
|
687
|
+
* @since [starter] 1.0
|
688
|
+
*/
|
689
|
+
function starter_auto_excerpt_more( $more ) {
|
690
|
+
return starter_continue_reading_link();
|
691
|
+
}
|
692
|
+
|
693
|
+
add_filter( 'excerpt_more', 'starter_auto_excerpt_more' );
|
694
|
+
add_filter( 'the_content_more_link', 'starter_auto_excerpt_more' );
|
695
|
+
|
696
|
+
/**
|
697
|
+
* Adds a pretty "Continue Reading" link to custom post excerpts.
|
698
|
+
*
|
699
|
+
* To override this link in a child theme, remove the filter and add your own
|
700
|
+
* function tied to the get_the_excerpt filter hook.
|
701
|
+
*
|
702
|
+
* @since [starter] 1.0
|
703
|
+
*/
|
704
|
+
function starter_custom_excerpt_more( $output ) {
|
705
|
+
if ( has_excerpt() and ! is_attachment() ) {
|
706
|
+
$output .= starter_continue_reading_link();
|
707
|
+
}
|
708
|
+
return $output;
|
709
|
+
}
|
710
|
+
|
711
|
+
add_filter( 'get_the_excerpt', 'starter_custom_excerpt_more' );
|
712
|
+
|
713
|
+
/**
|
714
|
+
* Adds nofollow rel atribute to content links
|
715
|
+
*
|
716
|
+
* @since [starter] 1.0
|
717
|
+
*/
|
718
|
+
function starter_nofollow_links_in_post( $text ) {
|
719
|
+
global $post;
|
720
|
+
|
721
|
+
if ( get_post_meta( $post->ID, 'nofollow_links', true ) ) {
|
722
|
+
preg_match_all( '/<a.*? href=\"(.*? )\".*?>(.*? )<\/a>/i', $text, $links );
|
723
|
+
$match_count = count( $links[0] );
|
724
|
+
|
725
|
+
for ( $i = 0; $i < $match_count; ++$i ) {
|
726
|
+
if ( ! preg_match( '/rel=[\"\']*nofollow[\"\']*/', $links[0][$i] ) ) {
|
727
|
+
preg_match_all( '/<a.*? href=\"(.*? )\"(.*? )>(.*? )<\/a>/i', $links[0][$i], $link_text );
|
728
|
+
|
729
|
+
$search = '>'.$link_text[3][0].'</a>';
|
730
|
+
$replace = ' rel="nofollow">'.$link_text[3][0].'</a>';
|
731
|
+
|
732
|
+
$text = str_replace( $search, $replace, $text );
|
733
|
+
}
|
734
|
+
}
|
735
|
+
}
|
736
|
+
|
737
|
+
return $text;
|
738
|
+
}
|
739
|
+
|
740
|
+
add_action( 'the_content', 'starter_nofollow_links_in_post' );
|
741
|
+
|
742
|
+
/**
|
743
|
+
* Custom tag clould args
|
744
|
+
*
|
745
|
+
* @since [starter] 1.0
|
746
|
+
*/
|
747
|
+
function starter_widget_tag_cloud_args( $args ) {
|
748
|
+
$args['number'] = 20; // show less tags
|
749
|
+
$args['largest'] = 13; // make largest and smallest the same
|
750
|
+
$args['smallest'] = 13;
|
751
|
+
$args['unit'] = 'px';
|
752
|
+
$args['format'] = 'list'; // ul with a class of wp-tag-cloud
|
753
|
+
// $args['exclude'] = array(20, 80, 92); // exclude tags by ID
|
754
|
+
// $args['taxonomy'] = array('post_tag', 'ingredients'); // add post tags and ingredients taxonomy
|
755
|
+
|
756
|
+
return $args;
|
757
|
+
}
|
758
|
+
|
759
|
+
add_filter( 'widget_tag_cloud_args', 'starter_widget_tag_cloud_args' );
|
760
|
+
|
761
|
+
/**
|
762
|
+
* Filter tag clould output so that it can be styled by CSS
|
763
|
+
*
|
764
|
+
* @since [starter] 1.0
|
765
|
+
*/
|
766
|
+
function starter_add_tag_class( $taglinks ) {
|
767
|
+
$tags = explode( '</a>', $taglinks );
|
768
|
+
$regex = "#(.*tag-link[-])(.*)(' title.*)#e";
|
769
|
+
foreach ( $tags as $tag ) {
|
770
|
+
$tagn[] = preg_replace( $regex, "('$1$2 label tag-'.get_tag($2)->slug.'$3')", $tag );
|
771
|
+
}
|
772
|
+
|
773
|
+
return implode( '</a>', $tagn );
|
774
|
+
}
|
775
|
+
|
776
|
+
add_filter( 'wp_tag_cloud', 'starter_add_tag_class' );
|
777
|
+
|
778
|
+
/**
|
779
|
+
* Outputs WP Pagenavi pagination or wordpress navigation
|
780
|
+
*
|
781
|
+
* @since [starter] 1.0
|
782
|
+
*/
|
783
|
+
function pagination( $query = false ) {
|
784
|
+
global $wp_query;
|
785
|
+
|
786
|
+
if ( is_single() ) {
|
787
|
+
?>
|
788
|
+
<nav id="comment-nav-below" class="navigation" role="navigation">
|
789
|
+
<h1 class="assistive-text section-heading"><?php _e( 'Post Navigation', 'starter' ); ?></h1>
|
790
|
+
<?php
|
791
|
+
if ( $previous = get_previous_post() ):?>
|
792
|
+
<div class="nav-previous alignleft">
|
793
|
+
<a href="<?php echo get_permalink( $previous );?>" title="<?php printf( __( 'Permalink to %s', 'starter' ), get_the_title( $previous ) );?>"><?php _e( 'Previous', 'starter' ); ?></a>
|
794
|
+
</div>
|
795
|
+
<?php endif;?>
|
796
|
+
<?php
|
797
|
+
if ( $next = get_next_post() ):?>
|
798
|
+
<div class="nav-next alignright">
|
799
|
+
<a href="<?php echo get_permalink( $next );?>" title="<?php printf( __( 'Permalink to %s', 'starter' ), get_the_title( $next ) );?>"><?php _e( 'Next', 'starter' ); ?></a>
|
800
|
+
</div>
|
801
|
+
<?php endif;?>
|
802
|
+
</nav>
|
803
|
+
<?php
|
804
|
+
} else {
|
805
|
+
if ( $wp_query->max_num_pages > 1 ) {
|
806
|
+
if ( function_exists( 'wp_pagenavi' ) ) {
|
807
|
+
$args = array( 'options' => PageNavi_Core::$options->get_defaults() );
|
808
|
+
if ( $query !== false ) {
|
809
|
+
$args['query'] = $query;
|
810
|
+
}
|
811
|
+
|
812
|
+
wp_pagenavi( $args );
|
813
|
+
} else {
|
814
|
+
//get_template_part( 'templates/pager' );
|
815
|
+
$big = 999999999; // This needs to be an unlikely integer
|
816
|
+
|
817
|
+
// For more options and info view the docs for paginate_links()
|
818
|
+
// http://codex.wordpress.org/Function_Reference/paginate_links
|
819
|
+
$paginate_links = paginate_links(
|
820
|
+
array(
|
821
|
+
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
|
822
|
+
'current' => max( 1, get_query_var( 'paged' ) ),
|
823
|
+
'total' => $wp_query->max_num_pages,
|
824
|
+
'mid_size' => 5,
|
825
|
+
'prev_next' => True,
|
826
|
+
'prev_text' => __( '←' ),
|
827
|
+
'next_text' => __( '→' ),
|
828
|
+
'type' => 'list',
|
829
|
+
)
|
830
|
+
);
|
831
|
+
|
832
|
+
// Display the pagination if more than one page is found
|
833
|
+
if ( $paginate_links ) {
|
834
|
+
echo $paginate_links;
|
835
|
+
}
|
836
|
+
}
|
837
|
+
}
|
838
|
+
}
|
839
|
+
}
|
840
|
+
|
841
|
+
add_action( 'pagination', 'pagination' );
|
842
|
+
|
843
|
+
/**
|
844
|
+
* Template for comments and pingbacks.
|
845
|
+
* Used as a callback by wp_list_comments() for displaying the comments.
|
846
|
+
*
|
847
|
+
* @since [starter] 1.0
|
848
|
+
*/
|
849
|
+
function starter_comment( $comment, $args, $depth ) {
|
850
|
+
$GLOBALS['comment'] = $comment;
|
851
|
+
switch ( $comment->comment_type ) {
|
852
|
+
case 'pingback' :
|
853
|
+
case 'trackback' :
|
854
|
+
// Display trackbacks differently than normal comments.
|
855
|
+
?>
|
856
|
+
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
|
857
|
+
<p><?php _e( 'Pingback:', 'starter' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'starter' ), '<span class="edit-link">', '</span>' ); ?></p>
|
858
|
+
<?php
|
859
|
+
break;
|
860
|
+
default :
|
861
|
+
// Proceed with normal comments.
|
862
|
+
global $post;
|
863
|
+
?>
|
864
|
+
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
865
|
+
<article id="comment-<?php comment_ID(); ?>" class="comment">
|
866
|
+
<header class="comment-meta comment-author vcard clearfix">
|
867
|
+
<?php
|
868
|
+
echo get_avatar( $comment, 44 );
|
869
|
+
printf(
|
870
|
+
'<cite class="fn">%1$s %2$s</cite>',
|
871
|
+
get_comment_author_link(),
|
872
|
+
// If current post author is also comment author, make it known visually.
|
873
|
+
( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'starter' ) . '</span>' : ''
|
874
|
+
);
|
875
|
+
printf(
|
876
|
+
'<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
|
877
|
+
esc_url( get_comment_link( $comment->comment_ID ) ),
|
878
|
+
get_comment_time( 'c' ),
|
879
|
+
/* translators: 1: date, 2: time */
|
880
|
+
sprintf( __( '%1$s at %2$s', 'starter' ), get_comment_date(), get_comment_time() )
|
881
|
+
);
|
882
|
+
?>
|
883
|
+
</header>
|
884
|
+
|
885
|
+
<?php
|
886
|
+
if ( '0' == $comment->comment_approved ):
|
887
|
+
?>
|
888
|
+
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'starter' ); ?></p>
|
889
|
+
<?php endif; ?>
|
890
|
+
|
891
|
+
<section class="comment-content comment clearfix">
|
892
|
+
<?php comment_text(); ?>
|
893
|
+
</section>
|
894
|
+
|
895
|
+
<div class="reply">
|
896
|
+
<?php edit_comment_link( __( 'Edit', 'starter' ), '<span class="edit-link">', '</span> / ' ); ?>
|
897
|
+
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'starter' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
|
898
|
+
</div>
|
899
|
+
</article>
|
900
|
+
<?php
|
901
|
+
break;
|
902
|
+
} // end comment_type check
|
903
|
+
}
|
904
|
+
|
905
|
+
/**
|
906
|
+
* Redirect to post when search query returns single result
|
907
|
+
*
|
908
|
+
* @see http://wpsnipp.com/index.php/functions-php/redirect-to-post-when-search-query-returns-single-result/
|
909
|
+
* @since [starter] 1.0
|
910
|
+
*/
|
911
|
+
function starter_single_result() {
|
912
|
+
if ( is_search() ) {
|
913
|
+
global $wp_query;
|
914
|
+
if ( $wp_query->post_count == 1 ) {
|
915
|
+
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
|
916
|
+
}
|
917
|
+
}
|
918
|
+
}
|
919
|
+
add_action( 'template_redirect', 'starter_single_result' );
|
920
|
+
|
921
|
+
/**
|
922
|
+
* Add postMessage support for site title and description for the Theme Customizer.
|
923
|
+
*
|
924
|
+
* @since [starter] 1.0
|
925
|
+
*
|
926
|
+
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
927
|
+
* @return void
|
928
|
+
*/
|
929
|
+
function starter_customize_register( $wp_customize ) {
|
930
|
+
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
|
931
|
+
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
|
932
|
+
}
|
933
|
+
add_action( 'customize_register', 'starter_customize_register' );
|
934
|
+
|
935
|
+
/* SHORTCODES */
|
936
|
+
|
937
|
+
// Allow shortcodes in widgets
|
938
|
+
add_filter( 'widget_text', 'do_shortcode' );
|
939
|
+
|
940
|
+
/**
|
941
|
+
* The supported attributes for the shortcode are 'id', 'align', 'width', and 'caption'.
|
942
|
+
*
|
943
|
+
* @since [starter] 1.0
|
944
|
+
*/
|
945
|
+
function starter_shortcode_caption( $atts, $content = null ) {
|
946
|
+
extract(
|
947
|
+
shortcode_atts(
|
948
|
+
array(
|
949
|
+
'id' => '',
|
950
|
+
'align' => 'alignnone',
|
951
|
+
'width' => '',
|
952
|
+
'caption' => '',
|
953
|
+
), $atts
|
954
|
+
)
|
955
|
+
);
|
956
|
+
|
957
|
+
if ( 1 > ( int ) $width )
|
958
|
+
return $content;
|
959
|
+
|
960
|
+
if ( empty( $caption ) ) {
|
961
|
+
preg_match( '/(<img[^>]+>)[ ]?(.*)/i', $content, $match );
|
962
|
+
$content = $match[1];
|
963
|
+
$caption = $match[2];
|
964
|
+
}
|
965
|
+
|
966
|
+
$id = $id ? $id : 'attachment_' . rand( 1, 999 );
|
967
|
+
$idtag = 'id="' . esc_attr( $id ) . '"';
|
968
|
+
|
969
|
+
$out[] = '<figure ' . $idtag . 'aria-describedby="figcaption_' . $id . '" class="post-image wp-caption ' . $align . '">';
|
970
|
+
$out[] = apply_filters( 'starter_shortcode_caption_content', do_shortcode( $content ), $id, '', '' );
|
971
|
+
$out[] = '<figcaption id="figcaption_' . $id . '" class="caption wp-caption-text">' . wpautop( wptexturize( $caption ) ) . '</figcaption>';
|
972
|
+
$out[] = '</figure>';
|
973
|
+
|
974
|
+
return implode( "\n", $out );
|
975
|
+
}
|
976
|
+
|
977
|
+
add_shortcode( 'wp_caption', 'starter_shortcode_caption' );
|
978
|
+
add_shortcode( 'caption', 'starter_shortcode_caption' );
|
979
|
+
|
980
|
+
/* ADMIN STUFF */
|
981
|
+
|
982
|
+
/**
|
983
|
+
* Remove unnecessary dashboard widgets
|
984
|
+
*
|
985
|
+
* @link http://www.deluxeblogtips.com/2011/01/remove-dashboard-widgets-in-wordpress.html
|
986
|
+
* @since [starter] 1.0
|
987
|
+
*/
|
988
|
+
function starter_remove_dashboard_widgets() {
|
989
|
+
// Incoming Links Widget
|
990
|
+
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
|
991
|
+
|
992
|
+
// Plugins Widget
|
993
|
+
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
|
994
|
+
|
995
|
+
remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );
|
996
|
+
remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
|
997
|
+
|
998
|
+
// Sitepress WPML Plugin Widget
|
999
|
+
remove_meta_box( 'icl_dashboard_widget', 'dashboard', 'normal' );
|
1000
|
+
|
1001
|
+
// Yoast's SEO Plugin Widget
|
1002
|
+
remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal' );
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
add_action( 'admin_init', 'starter_remove_dashboard_widgets' );
|
1006
|
+
|
1007
|
+
/**
|
1008
|
+
* Adds custom menu to admin bar
|
1009
|
+
*
|
1010
|
+
* @since [starter] 1.0
|
1011
|
+
*/
|
1012
|
+
function starter_bar_menu( $wp_admin_bar ) {
|
1013
|
+
if ( ! is_super_admin() or ! is_admin_bar_showing() )
|
1014
|
+
return;
|
1015
|
+
|
1016
|
+
/**
|
1017
|
+
* Change "Howdy"
|
1018
|
+
*/
|
1019
|
+
// get the node that contains "howdy"
|
1020
|
+
$my_account = $wp_admin_bar->get_node( 'my-account' );
|
1021
|
+
// change the "howdy"
|
1022
|
+
$my_account->title = str_replace( 'Howdy,', __( 'Hi,', 'starter' ), $my_account->title );
|
1023
|
+
// remove the original node
|
1024
|
+
$wp_admin_bar->remove_node( 'my-account' );
|
1025
|
+
// add back our modified version
|
1026
|
+
$wp_admin_bar->add_node( $my_account );
|
1027
|
+
|
1028
|
+
/**
|
1029
|
+
* Removing the "W" menu
|
1030
|
+
* I have nothing against it, but I *never* use it
|
1031
|
+
*/
|
1032
|
+
$wp_admin_bar->remove_menu( 'wp-logo' );
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* Create a "Favorites" menu
|
1036
|
+
* First, just create the parent menu item
|
1037
|
+
*/
|
1038
|
+
$wp_admin_bar->add_menu(
|
1039
|
+
array(
|
1040
|
+
'id' => 'favorites',
|
1041
|
+
'parent' => 'top-secondary', // puts it on the right-hand side
|
1042
|
+
'title' => __( 'Favorites', 'starter' ),
|
1043
|
+
)
|
1044
|
+
);
|
1045
|
+
|
1046
|
+
/**
|
1047
|
+
* Then add links to it
|
1048
|
+
* This link goes to the All Settings page,
|
1049
|
+
* so only show it to users that have appropriate privileges
|
1050
|
+
*/
|
1051
|
+
if ( current_user_can( 'manage_options' ) ) {
|
1052
|
+
$wp_admin_bar->add_menu(
|
1053
|
+
array(
|
1054
|
+
'id' => 'all-settings',
|
1055
|
+
'parent' => 'favorites',
|
1056
|
+
'title' => __( 'Options', 'starter' ),
|
1057
|
+
'href' => admin_url( 'options.php' ),
|
1058
|
+
)
|
1059
|
+
);
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
// This one goes to the list of the current user's posts
|
1063
|
+
$wp_admin_bar->add_menu(
|
1064
|
+
array(
|
1065
|
+
'id' => 'my-posts',
|
1066
|
+
'parent' => 'favorites',
|
1067
|
+
'title' => __( 'My Posts', 'starter' ),
|
1068
|
+
'href' => admin_url( 'edit.php?post_type=post&author=' . get_current_user_id() ),
|
1069
|
+
)
|
1070
|
+
);
|
1071
|
+
|
1072
|
+
// MySQL query and script execution timer output
|
1073
|
+
$wp_admin_bar->add_menu(
|
1074
|
+
array(
|
1075
|
+
'id' => 'do_query_bar',
|
1076
|
+
'parent' => 'top-secondary', // puts it on the right-hand side
|
1077
|
+
'title' => get_num_queries() . 'Q - ' . timer_stop() . 's', // link title
|
1078
|
+
'href' => '#',
|
1079
|
+
'meta' => false,
|
1080
|
+
)
|
1081
|
+
);
|
1082
|
+
}
|
1083
|
+
|
1084
|
+
add_action( 'admin_bar_menu', 'starter_bar_menu', '1000' );
|
1085
|
+
|
1086
|
+
/**
|
1087
|
+
* This simple hack will remove the AIM, Yahoo and Jabber fields and will replace them with a bunch of other social network profiles.
|
1088
|
+
*
|
1089
|
+
* @since [starter] 1.0
|
1090
|
+
*/
|
1091
|
+
function starter_user_contactmethods( $contactmethods ) {
|
1092
|
+
unset( $contactmethods['aim'], $contactmethods['yim'], $contactmethods['jabber'] );
|
1093
|
+
|
1094
|
+
// Add Location
|
1095
|
+
$contactmethods['user_location'] = __( 'Location', 'starter' );
|
1096
|
+
|
1097
|
+
// Add Facebook
|
1098
|
+
$contactmethods['user_fb'] = __( 'Facebook', 'starter' );
|
1099
|
+
|
1100
|
+
// Add Pinterest
|
1101
|
+
$contactmethods['user_pt'] = __( 'Pinterest', 'starter' );
|
1102
|
+
|
1103
|
+
// Add Twitter
|
1104
|
+
$contactmethods['user_tw'] = __( 'Twitter', 'starter' );
|
1105
|
+
|
1106
|
+
// Add Linkedin
|
1107
|
+
$contactmethods['user_lk'] = __( 'Linkedin', 'starter' );
|
1108
|
+
|
1109
|
+
// Add Github
|
1110
|
+
$contactmethods['user_gh'] = __( 'Github', 'starter' );
|
1111
|
+
|
1112
|
+
// Add Google+
|
1113
|
+
$contactmethods['google_profile'] = __( 'Google+ profile', 'starter' );
|
1114
|
+
|
1115
|
+
return $contactmethods;
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
add_filter( 'user_contactmethods', 'starter_user_contactmethods' );
|
1119
|
+
|
1120
|
+
/**
|
1121
|
+
* Allow more HTML tags in the editor
|
1122
|
+
* Add more languages to spell check
|
1123
|
+
*
|
1124
|
+
* @since [starter] 1.0
|
1125
|
+
*/
|
1126
|
+
function starter_change_mce_options( $array ) {
|
1127
|
+
$ext = 'pre[id|name|class|style],iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]';
|
1128
|
+
|
1129
|
+
if ( isset( $array['extended_valid_elements'] ) ) {
|
1130
|
+
$array['extended_valid_elements'] .= ','.$ext;
|
1131
|
+
}
|
1132
|
+
else {
|
1133
|
+
$array['extended_valid_elements'] = $ext;
|
1134
|
+
}
|
1135
|
+
|
1136
|
+
// Add block format elements you want to show in dropdown
|
1137
|
+
$array['theme_advanced_blockformats'] = 'h1,h2,h3,h4,p,code,blockquote';
|
1138
|
+
$array['theme_advanced_disable'] = 'strikethrough,underline,forecolor,justifyfull';
|
1139
|
+
$array[ 'spellchecker_languages' ] = '+Spanish=sp, English=en';
|
1140
|
+
|
1141
|
+
return $array;
|
1142
|
+
}
|
1143
|
+
|
1144
|
+
add_filter( 'tiny_mce_before_init', 'starter_change_mce_options' );
|
1145
|
+
|
1146
|
+
/**
|
1147
|
+
* Adds previous/next links to post edition window
|
1148
|
+
*
|
1149
|
+
* @since [starter] 1.0
|
1150
|
+
*/
|
1151
|
+
function starter_add_navigation_edit_posts() {
|
1152
|
+
if ( isset( $_GET['post'] ) and isset( $_GET['action'] ) and $_GET['action'] == 'edit' ) {
|
1153
|
+
global $post;
|
1154
|
+
|
1155
|
+
$args = array(
|
1156
|
+
'public' => true,
|
1157
|
+
'_builtin' => false,
|
1158
|
+
);
|
1159
|
+
$output = 'names'; // names or objects, note names is the default
|
1160
|
+
$operator = 'and'; // 'and' or 'or'
|
1161
|
+
|
1162
|
+
$post_types = get_post_types( $args, $output, $operator );
|
1163
|
+
|
1164
|
+
$post_types['post'] = 'post';
|
1165
|
+
$post_types['page'] = 'page';
|
1166
|
+
if ( is_object( $post ) and in_array( $post->post_type, $post_types ) ) {
|
1167
|
+
$wtf = array( true, false );
|
1168
|
+
foreach ( $wtf as $prev ) {
|
1169
|
+
$p = get_adjacent_post( false, '', $prev );
|
1170
|
+
|
1171
|
+
if ( ! empty( $p ) ) {
|
1172
|
+
echo '<script>
|
1173
|
+
jQuery(function($) {
|
1174
|
+
$(".wrap h2" )
|
1175
|
+
.append(\'<a class="add-new-h2" href="' . admin_url( 'post.php?action=edit&post=' . $p->ID ) . '" title="' . __( 'Editar', 'starter' ) . ' ' . apply_filters( 'the_title', $p->post_title ) . '">' . ( $prev ? '« ' : '' ) . apply_filters( 'the_title', $p->post_title ) . ( ! $prev ? ' »' : '' ) . '</a>\' );
|
1176
|
+
});
|
1177
|
+
</script>';
|
1178
|
+
}
|
1179
|
+
}
|
1180
|
+
}
|
1181
|
+
}
|
1182
|
+
}
|
1183
|
+
|
1184
|
+
add_action( 'admin_head', 'starter_add_navigation_edit_posts' );
|
1185
|
+
|
1186
|
+
/**
|
1187
|
+
* Custom Login Logo Support
|
1188
|
+
*
|
1189
|
+
* @since [starter] 1.0
|
1190
|
+
*/
|
1191
|
+
function starter_custom_login_logo() {
|
1192
|
+
echo '<style type="text/css">
|
1193
|
+
h1 a { background-image:url(' . get_template_directory_uri() . '/images/login-logo.png) !important; }
|
1194
|
+
</style>';
|
1195
|
+
}
|
1196
|
+
|
1197
|
+
add_action( 'login_head', 'starter_custom_login_logo' );
|
1198
|
+
|
1199
|
+
/**
|
1200
|
+
* Custom Login URL
|
1201
|
+
*
|
1202
|
+
* @since [starter] 1.0
|
1203
|
+
*/
|
1204
|
+
function starter_wp_login_url() {
|
1205
|
+
return home_url();
|
1206
|
+
}
|
1207
|
+
|
1208
|
+
add_filter( 'login_headerurl', 'starter_wp_login_url' );
|
1209
|
+
|
1210
|
+
/**
|
1211
|
+
* Custom Login Title
|
1212
|
+
*
|
1213
|
+
* @since [starter] 1.0
|
1214
|
+
*/
|
1215
|
+
function starter_wp_login_title() {
|
1216
|
+
return get_option( 'blogname' );
|
1217
|
+
}
|
1218
|
+
|
1219
|
+
add_filter( 'login_headertitle', 'starter_wp_login_title' );
|
1220
|
+
|
1221
|
+
/**
|
1222
|
+
* Custom Backend Footer
|
1223
|
+
*
|
1224
|
+
* @since [starter] 1.0
|
1225
|
+
*/
|
1226
|
+
function starter_custom_admin_footer() {
|
1227
|
+
$credits = '<span id="footer-thankyou">Crafted by <a href="//alexsancho.name" target="_blank">Alex Sancho</a></span>.';
|
1228
|
+
|
1229
|
+
echo apply_filters( 'starter_custom_admin_footer', $credits );
|
1230
|
+
}
|
1231
|
+
|
1232
|
+
// adding it to the admin area
|
1233
|
+
add_filter( 'admin_footer_text', 'starter_custom_admin_footer' );
|