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
@@ -7,59 +7,70 @@
|
|
7
7
|
* handled by a callback to starter_comment() which is
|
8
8
|
* located in the functions.php file.
|
9
9
|
*
|
10
|
-
* @
|
11
|
-
* @
|
12
|
-
* @author [Your Name]
|
13
|
-
* @copyright 2012 [Your Name]
|
10
|
+
* @package starter
|
11
|
+
* @since starter 1.0
|
14
12
|
*/
|
13
|
+
?>
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
<?php
|
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
23
|
?>
|
24
24
|
|
25
|
-
<div id="comments" class="comments-area">
|
25
|
+
<div id="comments" class="comments-area">
|
26
26
|
|
27
27
|
<?php // You can start editing here -- including this comment! ?>
|
28
28
|
|
29
29
|
<?php if ( have_comments() ) : ?>
|
30
30
|
<h2 class="comments-title">
|
31
31
|
<?php
|
32
|
-
printf(
|
33
|
-
|
34
|
-
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>'
|
35
|
-
);
|
32
|
+
printf( _n( 'One thought on “%2$s”', '%1$s thoughts on “%2$s”', get_comments_number(), 'starter' ),
|
33
|
+
number_format_i18n( get_comments_number() ), '<span>' . get_the_title() . '</span>' );
|
36
34
|
?>
|
37
35
|
</h2>
|
38
36
|
|
37
|
+
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
|
38
|
+
<nav role="navigation" id="comment-nav-above" class="site-navigation comment-navigation">
|
39
|
+
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'starter' ); ?></h1>
|
40
|
+
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'starter' ) ); ?></div>
|
41
|
+
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'starter' ) ); ?></div>
|
42
|
+
</nav><!-- #comment-nav-before .site-navigation .comment-navigation -->
|
43
|
+
<?php endif; // check for comment navigation ?>
|
44
|
+
|
39
45
|
<ol class="commentlist">
|
40
|
-
<?php
|
41
|
-
|
46
|
+
<?php
|
47
|
+
/* Loop through and list the comments. Tell wp_list_comments()
|
48
|
+
* to use starter_comment() to format the comments.
|
49
|
+
* If you want to overload this in a child theme then you can
|
50
|
+
* define starter_comment() and that will be used instead.
|
51
|
+
* See starter_comment() in inc/template-tags.php for more.
|
52
|
+
*/
|
53
|
+
wp_list_comments( array( 'callback' => 'starter_comment' ) );
|
54
|
+
?>
|
55
|
+
</ol><!-- .commentlist -->
|
42
56
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
<nav id="comment-nav-below" class="navigation" role="navigation">
|
47
|
-
<h1 class="assistive-text section-heading"><?php _e( 'Comment navigation', 'starter' ); ?></h1>
|
57
|
+
<?php if ( get_comment_pages_count() > 1 && get_option( 'page_comments' ) ) : // are there comments to navigate through ?>
|
58
|
+
<nav role="navigation" id="comment-nav-below" class="site-navigation comment-navigation">
|
59
|
+
<h1 class="assistive-text"><?php _e( 'Comment navigation', 'starter' ); ?></h1>
|
48
60
|
<div class="nav-previous"><?php previous_comments_link( __( '← Older Comments', 'starter' ) ); ?></div>
|
49
61
|
<div class="nav-next"><?php next_comments_link( __( 'Newer Comments →', 'starter' ) ); ?></div>
|
50
|
-
</nav
|
62
|
+
</nav><!-- #comment-nav-below .site-navigation .comment-navigation -->
|
51
63
|
<?php endif; // check for comment navigation ?>
|
52
64
|
|
65
|
+
<?php endif; // have_comments() ?>
|
66
|
+
|
53
67
|
<?php
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
<p class="nocomments"><?php _e( 'Comments are closed.' , 'starter' ); ?></p>
|
68
|
+
// If comments are closed and there are comments, let's leave a little note, shall we?
|
69
|
+
if ( ! comments_open() && '0' != get_comments_number() && post_type_supports( get_post_type(), 'comments' ) ) :
|
70
|
+
?>
|
71
|
+
<p class="nocomments"><?php _e( 'Comments are closed.', 'starter' ); ?></p>
|
59
72
|
<?php endif; ?>
|
60
73
|
|
61
|
-
<?php endif; // have_comments() ?>
|
62
|
-
|
63
74
|
<?php comment_form(); ?>
|
64
75
|
|
65
|
-
</div
|
76
|
+
</div><!-- #comments .comments-area -->
|
@@ -2,23 +2,19 @@
|
|
2
2
|
/**
|
3
3
|
* The template used for displaying page content in page.php
|
4
4
|
*
|
5
|
-
* @
|
6
|
-
* @
|
7
|
-
* @author [Your Name]
|
8
|
-
* @copyright 2012 [Your Name]
|
5
|
+
* @package starter
|
6
|
+
* @since starter 1.0
|
9
7
|
*/
|
10
8
|
?>
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
10
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
11
|
+
<header class="entry-header">
|
12
|
+
<h1 class="entry-title"><?php the_title(); ?></h1>
|
13
|
+
</header><!-- .entry-header -->
|
16
14
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
</
|
21
|
-
|
22
|
-
|
23
|
-
</footer>
|
24
|
-
</article>
|
15
|
+
<div class="entry-content">
|
16
|
+
<?php the_content(); ?>
|
17
|
+
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'starter' ), 'after' => '</div>' ) ); ?>
|
18
|
+
<?php edit_post_link( __( 'Edit', 'starter' ), '<span class="edit-link">', '</span>' ); ?>
|
19
|
+
</div><!-- .entry-content -->
|
20
|
+
</article><!-- #post-<?php the_ID(); ?> -->
|
@@ -0,0 +1,59 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* @package starter
|
4
|
+
* @since starter 1.0
|
5
|
+
*/
|
6
|
+
?>
|
7
|
+
|
8
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
9
|
+
<header class="entry-header">
|
10
|
+
<h1 class="entry-title"><?php the_title(); ?></h1>
|
11
|
+
|
12
|
+
<div class="entry-meta">
|
13
|
+
<?php starter_posted_on(); ?>
|
14
|
+
</div><!-- .entry-meta -->
|
15
|
+
</header><!-- .entry-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><!-- .entry-content -->
|
21
|
+
|
22
|
+
<footer class="entry-meta">
|
23
|
+
<?php
|
24
|
+
/* translators: used between list items, there is a space after the comma */
|
25
|
+
$category_list = get_the_category_list( __( ', ', 'starter' ) );
|
26
|
+
|
27
|
+
/* translators: used between list items, there is a space after the comma */
|
28
|
+
$tag_list = get_the_tag_list( '', __( ', ', 'starter' ) );
|
29
|
+
|
30
|
+
if ( ! starter_categorized_blog() ) {
|
31
|
+
// This blog only has 1 category so we just need to worry about tags in the meta text
|
32
|
+
if ( '' != $tag_list ) {
|
33
|
+
$meta_text = __( 'This entry was tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'starter' );
|
34
|
+
} else {
|
35
|
+
$meta_text = __( 'Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'starter' );
|
36
|
+
}
|
37
|
+
|
38
|
+
} else {
|
39
|
+
// But this blog has loads of categories so we should probably display them here
|
40
|
+
if ( '' != $tag_list ) {
|
41
|
+
$meta_text = __( 'This entry was posted in %1$s and tagged %2$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'starter' );
|
42
|
+
} else {
|
43
|
+
$meta_text = __( 'This entry was posted in %1$s. Bookmark the <a href="%3$s" title="Permalink to %4$s" rel="bookmark">permalink</a>.', 'starter' );
|
44
|
+
}
|
45
|
+
|
46
|
+
} // end check for categories on this blog
|
47
|
+
|
48
|
+
printf(
|
49
|
+
$meta_text,
|
50
|
+
$category_list,
|
51
|
+
$tag_list,
|
52
|
+
get_permalink(),
|
53
|
+
the_title_attribute( 'echo=0' )
|
54
|
+
);
|
55
|
+
?>
|
56
|
+
|
57
|
+
<?php edit_post_link( __( 'Edit', 'starter' ), '<span class="edit-link">', '</span>' ); ?>
|
58
|
+
</footer><!-- .entry-meta -->
|
59
|
+
</article><!-- #post-<?php the_ID(); ?> -->
|
@@ -1,67 +1,61 @@
|
|
1
1
|
<?php
|
2
2
|
/**
|
3
|
-
*
|
4
|
-
*
|
5
|
-
* @category Theme
|
6
|
-
* @package [starter]
|
7
|
-
* @author [Your Name]
|
8
|
-
* @copyright 2012 [Your Name]
|
3
|
+
* @package starter
|
4
|
+
* @since starter 1.0
|
9
5
|
*/
|
10
6
|
?>
|
11
7
|
|
12
|
-
|
13
|
-
|
14
|
-
<
|
15
|
-
|
16
|
-
|
8
|
+
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
|
9
|
+
<header class="entry-header">
|
10
|
+
<h1 class="entry-title"><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></h1>
|
11
|
+
|
12
|
+
<?php if ( 'post' == get_post_type() ) : ?>
|
13
|
+
<div class="entry-meta">
|
14
|
+
<?php starter_posted_on(); ?>
|
15
|
+
</div><!-- .entry-meta -->
|
17
16
|
<?php endif; ?>
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
17
|
+
</header><!-- .entry-header -->
|
18
|
+
|
19
|
+
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
|
20
|
+
<div class="entry-summary">
|
21
|
+
<?php the_excerpt(); ?>
|
22
|
+
</div><!-- .entry-summary -->
|
23
|
+
<?php else : ?>
|
24
|
+
<div class="entry-content">
|
25
|
+
<?php the_content( __( 'Continue reading <span class="meta-nav">→</span>', 'starter' ) ); ?>
|
26
|
+
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'starter' ), 'after' => '</div>' ) ); ?>
|
27
|
+
</div><!-- .entry-content -->
|
28
|
+
<?php endif; ?>
|
29
|
+
|
30
|
+
<footer class="entry-meta">
|
31
|
+
<?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
|
32
|
+
<?php
|
33
|
+
/* translators: used between list items, there is a space after the comma */
|
34
|
+
$categories_list = get_the_category_list( __( ', ', 'starter' ) );
|
35
|
+
if ( $categories_list && starter_categorized_blog() ) :
|
36
|
+
?>
|
37
|
+
<span class="cat-links">
|
38
|
+
<?php printf( __( 'Posted in %1$s', 'starter' ), $categories_list ); ?>
|
39
|
+
</span>
|
40
|
+
<?php endif; // End if categories ?>
|
41
|
+
|
42
|
+
<?php
|
43
|
+
/* translators: used between list items, there is a space after the comma */
|
44
|
+
$tags_list = get_the_tag_list( '', __( ', ', 'starter' ) );
|
45
|
+
if ( $tags_list ) :
|
46
|
+
?>
|
47
|
+
<span class="sep"> | </span>
|
48
|
+
<span class="tags-links">
|
49
|
+
<?php printf( __( 'Tagged %1$s', 'starter' ), $tags_list ); ?>
|
50
|
+
</span>
|
51
|
+
<?php endif; // End if $tags_list ?>
|
52
|
+
<?php endif; // End if 'post' == get_post_type() ?>
|
33
53
|
|
34
|
-
<?php if (
|
35
|
-
|
36
|
-
<
|
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>
|
54
|
+
<?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
|
55
|
+
<span class="sep"> | </span>
|
56
|
+
<span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'starter' ), __( '1 Comment', 'starter' ), __( '% Comments', 'starter' ) ); ?></span>
|
44
57
|
<?php endif; ?>
|
45
58
|
|
46
|
-
<
|
47
|
-
|
48
|
-
|
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>
|
59
|
+
<?php edit_post_link( __( 'Edit', 'starter' ), '<span class="sep"> | </span><span class="edit-link">', '</span>' ); ?>
|
60
|
+
</footer><!-- .entry-meta -->
|
61
|
+
</article><!-- #post-<?php the_ID(); ?> -->
|
@@ -1,29 +1,27 @@
|
|
1
1
|
<?php
|
2
2
|
/**
|
3
|
-
* The
|
3
|
+
* The template for displaying the footer.
|
4
4
|
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* @
|
8
|
-
* @
|
5
|
+
* Contains the closing of the id=main div and all content after
|
6
|
+
*
|
7
|
+
* @package starter
|
8
|
+
* @since starter 1.0
|
9
9
|
*/
|
10
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
11
|
|
26
|
-
|
27
|
-
|
28
|
-
|
12
|
+
</div><!-- #main .site-main -->
|
13
|
+
|
14
|
+
<footer id="colophon" class="site-footer" role="contentinfo">
|
15
|
+
<div class="site-info">
|
16
|
+
<?php do_action( 'starter_credits' ); ?>
|
17
|
+
<a href="//wordpress.org/" title="<?php esc_attr_e( 'A Semantic Personal Publishing Platform', 'starter' ); ?>" rel="generator"><?php printf( __( 'Proudly powered by %s', 'starter' ), 'WordPress' ); ?></a>
|
18
|
+
<span class="sep"> | </span>
|
19
|
+
<?php printf( __( 'Theme: %1$s by %2$s.', 'starter' ), 'starter', '<a href="//underscores.me/" rel="designer">Underscores.me</a>' ); ?>
|
20
|
+
</div><!-- .site-info -->
|
21
|
+
</footer><!-- #colophon .site-footer -->
|
22
|
+
</div><!-- #page .hfeed .site -->
|
23
|
+
|
24
|
+
<?php wp_footer(); ?>
|
25
|
+
|
26
|
+
</body>
|
29
27
|
</html>
|
@@ -1,26 +1,20 @@
|
|
1
1
|
<?php
|
2
2
|
/**
|
3
|
-
*
|
3
|
+
* starter functions and definitions
|
4
4
|
*
|
5
|
-
*
|
6
|
-
*
|
7
|
-
* @category Theme
|
8
|
-
* @package [starter]
|
9
|
-
* @author [Your Name]
|
10
|
-
* @copyright 2012 [Your Name]
|
5
|
+
* @package starter
|
6
|
+
* @since starter 1.0
|
11
7
|
*/
|
12
8
|
|
13
|
-
global $of_options, $data;
|
14
|
-
|
15
9
|
/**
|
16
10
|
* Set the content width based on the theme's design and stylesheet.
|
17
11
|
*
|
18
|
-
*
|
19
|
-
* is designed for, generally via the style.css stylesheet.
|
12
|
+
* @since starter 1.0
|
20
13
|
*/
|
21
14
|
if ( ! isset( $content_width ) )
|
22
|
-
$content_width =
|
15
|
+
$content_width = 640; /* pixels */
|
23
16
|
|
17
|
+
if ( ! function_exists( 'starter_setup' ) ) :
|
24
18
|
/**
|
25
19
|
* Sets up theme defaults and registers support for various WordPress features.
|
26
20
|
*
|
@@ -28,1184 +22,94 @@ if ( ! isset( $content_width ) )
|
|
28
22
|
* before the init hook. The init hook is too late for some features, such as indicating
|
29
23
|
* support post thumbnails.
|
30
24
|
*
|
31
|
-
*
|
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
|
25
|
+
* @since starter 1.0
|
42
26
|
*/
|
43
27
|
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( 670, 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
|
-
/*------------------------------------------*/
|
66
|
-
/* Options Framework
|
67
|
-
/*------------------------------------------*/
|
68
|
-
locate_template( 'options.php', true );
|
69
|
-
locate_template( 'admin/index.php', true );
|
70
|
-
|
71
|
-
do_action( 'starter_setup' );
|
72
|
-
}
|
73
|
-
|
74
|
-
add_action( 'after_setup_theme', 'starter_setup' );
|
75
|
-
|
76
|
-
/**
|
77
|
-
* Some cleanup
|
78
|
-
*
|
79
|
-
* @since [starter] 1.0
|
80
|
-
* @return void
|
81
|
-
*/
|
82
|
-
function starter_init() {
|
83
|
-
// autolinks in comments
|
84
|
-
remove_filter( 'comment_text', 'make_clickable', 9 );
|
85
|
-
|
86
|
-
// Display the links to the general feeds: Post and Comment Feed
|
87
|
-
remove_action( 'wp_head', 'feed_links', 2 );
|
88
|
-
|
89
|
-
// Display the links to the extra feeds such as category feeds
|
90
|
-
remove_action( 'wp_head', 'feed_links_extra', 3 );
|
91
|
-
|
92
|
-
// Display the link to the Really Simple Discovery service endpoint, EditURI link
|
93
|
-
remove_action( 'wp_head', 'rsd_link' );
|
94
|
-
|
95
|
-
// Display the link to the Windows Live Writer manifest file.
|
96
|
-
remove_action( 'wp_head', 'wlwmanifest_link' );
|
97
|
-
remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
|
98
|
-
|
99
|
-
// index link
|
100
|
-
remove_action( 'wp_head', 'index_rel_link' );
|
101
|
-
|
102
|
-
// prev link
|
103
|
-
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 );
|
104
|
-
|
105
|
-
// start link
|
106
|
-
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 );
|
107
|
-
|
108
|
-
// Display relational links for the posts adjacent to the current post.
|
109
|
-
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 );
|
110
|
-
|
111
|
-
// Display the XHTML generator that is generated on the wp_head hook, WP version
|
112
|
-
remove_action( 'wp_head', 'wp_generator' );
|
113
|
-
remove_action( 'wp_head', 'wp_shortlink_wp_head', 10, 0 );
|
114
|
-
|
115
|
-
// remove jetpack open graph tags
|
116
|
-
remove_action( 'wp_head', 'jetpack_og_tags' );
|
117
|
-
|
118
|
-
add_filter( 'use_default_gallery_style', '__return_null' );
|
119
|
-
|
120
|
-
/* Custom oEmbed Providers */
|
121
|
-
|
122
|
-
// Add Soundcloud oEmbed
|
123
|
-
wp_oembed_add_provider( '#http://(www\.)?soundcloud\.com/.*#i', 'http://soundcloud.com/oembed', true );
|
124
|
-
|
125
|
-
// Add Kickstarter oEmbed
|
126
|
-
wp_oembed_add_provider( '#http://(www\.)?kickstarter\.com/projects/.*#i', 'http://www.kickstarter.com/services/oembed', true );
|
127
|
-
|
128
|
-
// Add Instagram oEmbed
|
129
|
-
wp_oembed_add_provider( '#http://(www\.)?instagr(am)?\.(am|com)/.*#i', 'http://api.instagram.com/oembed', true );
|
130
|
-
|
131
|
-
// Add Slideshare oEmbed
|
132
|
-
wp_oembed_add_provider( '#http://(www\.)?slideshare\.net/.*#i', 'http://api.embed.ly/v1/api/oembed', true );
|
133
|
-
}
|
134
|
-
|
135
|
-
add_action( 'init', 'starter_init' );
|
136
|
-
|
137
|
-
/**
|
138
|
-
* Remove the WordPress version from RSS feeds
|
139
|
-
*/
|
140
|
-
add_filter( 'the_generator', '__return_false' );
|
141
|
-
|
142
|
-
/**
|
143
|
-
* Adds custom scripts to theme header
|
144
|
-
*
|
145
|
-
* @since [starter] 1.0
|
146
|
-
* @return void
|
147
|
-
*/
|
148
|
-
function starter_enqueue_scripts() {
|
149
|
-
$theme = wp_get_theme();
|
150
|
-
$version = $theme['Version'];
|
151
|
-
|
152
|
-
wp_deregister_script( 'jquery' );
|
153
|
-
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3' );
|
154
28
|
|
155
29
|
/**
|
156
|
-
*
|
157
|
-
* to support sites with threaded comments (when in use).
|
30
|
+
* Custom template tags for this theme.
|
158
31
|
*/
|
159
|
-
|
160
|
-
wp_enqueue_script( 'comment-reply' );
|
161
|
-
}
|
162
|
-
|
163
|
-
wp_enqueue_script( 'modernizr', get_template_directory_uri() . '/javascripts/modernizr.min.js', false, '2.6.2' );
|
164
|
-
wp_enqueue_script( 'app', get_template_directory_uri() . '/javascripts/app.js', array( 'jquery' ), $version, true );
|
165
|
-
}
|
166
|
-
|
167
|
-
add_action( 'wp_enqueue_scripts', 'starter_enqueue_scripts' );
|
168
|
-
|
169
|
-
/**
|
170
|
-
* Adds custom styles to theme header
|
171
|
-
*
|
172
|
-
* @since [starter] 1.0
|
173
|
-
* @return void
|
174
|
-
*/
|
175
|
-
function starter_enqueue_styles() {
|
176
|
-
$theme = wp_get_theme();
|
177
|
-
$version = $theme['Version'];
|
178
|
-
|
179
|
-
wp_enqueue_style( 'app', get_stylesheet_uri(), false, $version, 'all' );
|
180
|
-
}
|
181
|
-
|
182
|
-
add_action( 'wp_enqueue_scripts', 'starter_enqueue_styles' );
|
183
|
-
|
184
|
-
/**
|
185
|
-
* Makes some changes to the <title> tag, by filtering the output of wp_title().
|
186
|
-
*
|
187
|
-
* If we have a site description and we're viewing the home page or a blog posts
|
188
|
-
* page (when using a static front page), then we will add the site description.
|
189
|
-
*
|
190
|
-
* If we're viewing a search result, then we're going to recreate the title entirely.
|
191
|
-
* We're going to add page numbers to all titles as well, to the middle of a search
|
192
|
-
* result title and the end of all other titles.
|
193
|
-
*
|
194
|
-
* The site title also gets added to all titles.
|
195
|
-
*
|
196
|
-
* @since [starter] 1.0
|
197
|
-
*
|
198
|
-
* @param string $title Title generated by wp_title()
|
199
|
-
* @param string $separator The separator passed to wp_title(). Base theme uses a vertical bar, "|", as a separator in header.php.
|
200
|
-
* @return string The new title, ready for the <title> tag.
|
201
|
-
*/
|
202
|
-
function starter_filter_wp_title( $title, $separator ) {
|
203
|
-
// Don't affect wp_title() calls in feeds.
|
204
|
-
if ( is_feed() or function_exists( 'get_wpseo_options' ) )
|
205
|
-
return $title;
|
206
|
-
|
207
|
-
// The $paged global variable contains the page number of a listing of posts.
|
208
|
-
// The $page global variable contains the page number of a single post that is paged.
|
209
|
-
// We'll display whichever one applies, if we're not looking at the first page.
|
210
|
-
global $paged, $page, $post;
|
211
|
-
|
212
|
-
if ( is_search() ) {
|
213
|
-
// If we're a search, let's start over:
|
214
|
-
$title = sprintf( __( 'Search results for %s', 'starter' ), '"' . get_search_query() . '"' );
|
215
|
-
// Add a page number if we're on page 2 or more:
|
216
|
-
if ( $paged >= 2 ) {
|
217
|
-
$title .= " $separator " . sprintf( __( 'Page %s', 'starter' ), $paged );
|
218
|
-
}
|
219
|
-
// Add the site name to the end:
|
220
|
-
$title .= " $separator " . get_bloginfo( 'name', 'display' );
|
221
|
-
// We're done. Let's send the new title back to wp_title():
|
222
|
-
return $title;
|
223
|
-
}
|
224
|
-
|
225
|
-
$return = array();
|
226
|
-
|
227
|
-
if ( $title != '' ) {
|
228
|
-
$return[] = str_replace( " $separator ", '', apply_filters( 'the_category', $title ) );
|
229
|
-
}
|
230
|
-
|
231
|
-
if ( is_single() ) {
|
232
|
-
if ( get_post_meta( $post->ID, 'title', true ) ) {
|
233
|
-
$return[] = stripslashes( get_post_meta( $post->ID, 'seo_title', true ) );
|
234
|
-
}
|
235
|
-
elseif ( ! in_array( $post->post_type, array( 'post', 'page', 'attachment' ) ) ) {
|
236
|
-
$post_type_obj = get_post_type_object( $post->post_type );
|
237
|
-
$return[] = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name );
|
238
|
-
}
|
239
|
-
}
|
240
|
-
|
241
|
-
// Add a page number if necessary:
|
242
|
-
if ( $paged >= 2 or $page >= 2 ) {
|
243
|
-
$return[] = sprintf( __( 'Page %s', 'starter' ), max( $paged, $page ) );
|
244
|
-
}
|
245
|
-
|
246
|
-
// Add the site name to the end:
|
247
|
-
$return[] = get_bloginfo( 'name', 'display' );
|
248
|
-
|
249
|
-
// If we have a site description and we're on the home/front page, add the description:
|
250
|
-
$site_description = get_bloginfo( 'description', 'display' );
|
251
|
-
if ( $site_description and ( is_home() or is_front_page() ) ) {
|
252
|
-
$return[] = $site_description;
|
253
|
-
}
|
254
|
-
|
255
|
-
// Return the new title to wp_title():
|
256
|
-
return implode( " $separator ", $return );
|
257
|
-
}
|
258
|
-
|
259
|
-
add_filter( 'wp_title', 'starter_filter_wp_title', 10, 3 );
|
260
|
-
|
261
|
-
/**
|
262
|
-
* Adds code to header
|
263
|
-
*
|
264
|
-
* @since [starter] 1.0
|
265
|
-
* @return string misc
|
266
|
-
*/
|
267
|
-
function starter_header() {
|
268
|
-
?>
|
269
|
-
<!-- For third-generation iPad with high-resolution Retina display: -->
|
270
|
-
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png?1333401433">
|
271
|
-
<!-- For iPhone with high-resolution Retina display: -->
|
272
|
-
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png?1333401433">
|
273
|
-
<!-- For first- and second-generation iPad: -->
|
274
|
-
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png?1333401433">
|
275
|
-
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
276
|
-
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png?1333401433">
|
277
|
-
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
278
|
-
<link rel="shortcut icon" href="favicon.ico?1333401433" type="image/x-icon" />
|
279
|
-
<?php
|
280
|
-
do_action( 'starter_header' );
|
281
|
-
}
|
282
|
-
|
283
|
-
add_action( 'wp_head', 'starter_header', 10 );
|
284
|
-
|
285
|
-
/**
|
286
|
-
* Adds code to footer
|
287
|
-
*
|
288
|
-
* @since [starter] 1.0
|
289
|
-
* @return string misc
|
290
|
-
*/
|
291
|
-
function starter_footer() {}
|
292
|
-
|
293
|
-
add_action( 'wp_footer', 'starter_footer', 10 );
|
294
|
-
|
295
|
-
/**
|
296
|
-
* Defines widget areas
|
297
|
-
*
|
298
|
-
* @since [starter] 1.0
|
299
|
-
* @return void
|
300
|
-
*/
|
301
|
-
function starter_widgets_init() {
|
302
|
-
register_sidebar(
|
303
|
-
array(
|
304
|
-
'name' => __( 'Primary widget area', 'starter' ),
|
305
|
-
'id' => 'primary-widget-area',
|
306
|
-
'description' => __( '', 'starter' ),
|
307
|
-
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
|
308
|
-
'after_widget' => '</li>',
|
309
|
-
'before_title' => '<h3 class="widget-title">',
|
310
|
-
'after_title' => '</h3>',
|
311
|
-
)
|
312
|
-
);
|
313
|
-
}
|
314
|
-
|
315
|
-
add_action( 'widgets_init', 'starter_widgets_init' );
|
316
|
-
|
317
|
-
/**
|
318
|
-
* Clean up output of stylesheet <link> tags
|
319
|
-
*
|
320
|
-
* @since [starter] 1.0
|
321
|
-
*/
|
322
|
-
function starter_clean_style_tag( $input ) {
|
323
|
-
preg_match_all( "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches );
|
324
|
-
// Only display media if it's print
|
325
|
-
$media = $matches[3][0] == 'print' ? ' media="print"' : '';
|
326
|
-
|
327
|
-
return '<link rel="stylesheet" href="' . $matches[ 2 ][ 0 ] . '"' . $media . '>' . "\n";
|
328
|
-
}
|
329
|
-
|
330
|
-
add_filter( 'style_loader_tag', 'starter_clean_style_tag' );
|
331
|
-
|
332
|
-
/**
|
333
|
-
* Remove unnecessary self-closing tags
|
334
|
-
*
|
335
|
-
* @since [starter] 1.0
|
336
|
-
*/
|
337
|
-
function starter_remove_self_closing_tags( $input ) {
|
338
|
-
return str_replace( ' />', '>', $input );
|
339
|
-
}
|
340
|
-
|
341
|
-
add_filter( 'get_avatar', 'starter_remove_self_closing_tags' ); // <img />
|
342
|
-
add_filter( 'comment_id_fields', 'starter_remove_self_closing_tags' ); // <input />
|
343
|
-
add_filter( 'post_thumbnail_html', 'starter_remove_self_closing_tags' ); // <img />
|
344
|
-
|
345
|
-
/**
|
346
|
-
* Wrap embedded media as suggested by Readability
|
347
|
-
*
|
348
|
-
* @link https://gist.github.com/965956
|
349
|
-
* @link http://www.readability.com/publishers/guidelines#publisher
|
350
|
-
* @since [starter] 1.0
|
351
|
-
*/
|
352
|
-
function starter_embed_wrap( $cache, $url, $attr = '', $post_ID = '' ) {
|
353
|
-
return '<div class="entry-content-asset">' . $cache . '</div>';
|
354
|
-
}
|
355
|
-
|
356
|
-
add_filter( 'embed_oembed_html', 'starter_embed_wrap', 10, 4 );
|
357
|
-
add_filter( 'embed_googlevideo', 'starter_embed_wrap', 10, 2 );
|
358
|
-
|
359
|
-
/**
|
360
|
-
* Remove height/width attributes on images so they can be responsive
|
361
|
-
*
|
362
|
-
* @since [starter] 1.0
|
363
|
-
*/
|
364
|
-
function starter_remove_thumbnail_dimensions( $html, $id, $alt, $title ) {
|
365
|
-
return preg_replace(
|
366
|
-
array(
|
367
|
-
'/\s+width="\d+"/i',
|
368
|
-
'/\s+height="\d+"/i',
|
369
|
-
'/alt=""/i',
|
370
|
-
),
|
371
|
-
array(
|
372
|
-
'',
|
373
|
-
'',
|
374
|
-
'',
|
375
|
-
'alt="' . $title . '"',
|
376
|
-
),
|
377
|
-
$html
|
378
|
-
);
|
379
|
-
}
|
380
|
-
|
381
|
-
add_filter( 'post_thumbnail_html', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
382
|
-
add_filter( 'image_send_to_editor', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
383
|
-
add_filter( 'get_image_tag', 'starter_remove_thumbnail_dimensions', 10, 4 );
|
384
|
-
|
385
|
-
/**
|
386
|
-
* Clean the output of attributes of images in editor.
|
387
|
-
*
|
388
|
-
* @link http://www.sitepoint.com/wordpress-change-img-tag-html/
|
389
|
-
* @since [starter] 1.0
|
390
|
-
*/
|
391
|
-
function starter_image_tag_class( $class, $id, $align, $size ) {
|
392
|
-
$align = 'align' . esc_attr( $align );
|
393
|
-
return $align;
|
394
|
-
}
|
395
|
-
|
396
|
-
add_filter( 'get_image_tag_class', 'starter_image_tag_class', 0, 4 );
|
397
|
-
|
398
|
-
/**
|
399
|
-
* Add thumbnail class to thumbnail links
|
400
|
-
*
|
401
|
-
* @since [starter] 1.0
|
402
|
-
*/
|
403
|
-
function starter_add_class_attachment_link( $html ) {
|
404
|
-
$postid = get_the_ID();
|
405
|
-
$html = str_replace( '<a', '<a class="thumbnail"', $html );
|
406
|
-
|
407
|
-
return $html;
|
408
|
-
}
|
409
|
-
|
410
|
-
add_filter( 'wp_get_attachment_link', '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
|
-
);
|
32
|
+
require( get_template_directory() . '/inc/template-tags.php' );
|
566
33
|
|
567
|
-
|
568
|
-
|
569
|
-
|
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">%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
|
-
|
809
|
-
if ( $query ) {
|
810
|
-
$args[ 'query' ] = $query;
|
811
|
-
}
|
812
|
-
|
813
|
-
wp_pagenavi( $args );
|
814
|
-
} else {
|
815
|
-
//get_template_part( 'templates/pager' );
|
816
|
-
$big = 999999999; // This needs to be an unlikely integer
|
817
|
-
|
818
|
-
// For more options and info view the docs for paginate_links()
|
819
|
-
// http://codex.wordpress.org/Function_Reference/paginate_links
|
820
|
-
$paginate_links = paginate_links(
|
821
|
-
array(
|
822
|
-
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
|
823
|
-
'current' => max( 1, get_query_var( 'paged' ) ),
|
824
|
-
'total' => $wp_query->max_num_pages,
|
825
|
-
'mid_size' => 5,
|
826
|
-
'prev_next' => True,
|
827
|
-
'prev_text' => __( '←' ),
|
828
|
-
'next_text' => __( '→' ),
|
829
|
-
'type' => 'list',
|
830
|
-
)
|
831
|
-
);
|
832
|
-
|
833
|
-
// Display the pagination if more than one page is found
|
834
|
-
if ( $paginate_links ) {
|
835
|
-
echo $paginate_links;
|
836
|
-
}
|
837
|
-
}
|
838
|
-
}
|
839
|
-
}
|
840
|
-
}
|
841
|
-
|
842
|
-
add_action( 'pagination', 'pagination' );
|
843
|
-
|
844
|
-
/**
|
845
|
-
* Template for comments and pingbacks.
|
846
|
-
* Used as a callback by wp_list_comments() for displaying the comments.
|
847
|
-
*
|
848
|
-
* @since [starter] 1.0
|
849
|
-
*/
|
850
|
-
function starter_comment( $comment, $args, $depth ) {
|
851
|
-
$GLOBALS['comment'] = $comment;
|
852
|
-
switch ( $comment->comment_type ) {
|
853
|
-
case 'pingback' :
|
854
|
-
case 'trackback' :
|
855
|
-
// Display trackbacks differently than normal comments.
|
856
|
-
?>
|
857
|
-
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
|
858
|
-
<p><?php _e( 'Pingback:', 'starter' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'starter' ), '<span class="edit-link">', '</span>' ); ?></p>
|
859
|
-
<?php
|
860
|
-
break;
|
861
|
-
default :
|
862
|
-
// Proceed with normal comments.
|
863
|
-
global $post;
|
864
|
-
?>
|
865
|
-
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
866
|
-
<article id="comment-<?php comment_ID(); ?>" class="comment">
|
867
|
-
<header class="comment-meta comment-author vcard clearfix">
|
868
|
-
<?php
|
869
|
-
echo get_avatar( $comment, 44 );
|
870
|
-
printf(
|
871
|
-
'<cite class="fn">%1$s %2$s</cite>',
|
872
|
-
get_comment_author_link(),
|
873
|
-
// If current post author is also comment author, make it known visually.
|
874
|
-
( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'starter' ) . '</span>' : ''
|
875
|
-
);
|
876
|
-
printf(
|
877
|
-
'<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
|
878
|
-
esc_url( get_comment_link( $comment->comment_ID ) ),
|
879
|
-
get_comment_time( 'c' ),
|
880
|
-
/* translators: 1: date, 2: time */
|
881
|
-
sprintf( __( '%1$s at %2$s', 'starter' ), get_comment_date(), get_comment_time() )
|
882
|
-
);
|
883
|
-
?>
|
884
|
-
</header>
|
885
|
-
|
886
|
-
<?php
|
887
|
-
if ( '0' == $comment->comment_approved ):
|
888
|
-
?>
|
889
|
-
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'starter' ); ?></p>
|
890
|
-
<?php endif; ?>
|
891
|
-
|
892
|
-
<section class="comment-content comment clearfix">
|
893
|
-
<?php comment_text(); ?>
|
894
|
-
</section>
|
895
|
-
|
896
|
-
<div class="reply">
|
897
|
-
<?php edit_comment_link( __( 'Edit', 'starter' ), '<span class="edit-link">', '</span> / ' ); ?>
|
898
|
-
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'starter' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
|
899
|
-
</div>
|
900
|
-
</article>
|
901
|
-
<?php
|
902
|
-
break;
|
903
|
-
} // end comment_type check
|
904
|
-
}
|
905
|
-
|
906
|
-
/**
|
907
|
-
* Redirect to post when search query returns single result
|
908
|
-
*
|
909
|
-
* @see http://wpsnipp.com/index.php/functions-php/redirect-to-post-when-search-query-returns-single-result/
|
910
|
-
* @since [starter] 1.0
|
911
|
-
*/
|
912
|
-
function starter_single_result() {
|
913
|
-
if ( is_search() ) {
|
914
|
-
global $wp_query;
|
915
|
-
if ( $wp_query->post_count == 1 ) {
|
916
|
-
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
|
917
|
-
}
|
918
|
-
}
|
919
|
-
}
|
920
|
-
add_action( 'template_redirect', 'starter_single_result' );
|
921
|
-
|
922
|
-
/**
|
923
|
-
* Add postMessage support for site title and description for the Theme Customizer.
|
924
|
-
*
|
925
|
-
* @since [starter] 1.0
|
926
|
-
*
|
927
|
-
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
928
|
-
* @return void
|
929
|
-
*/
|
930
|
-
function starter_customize_register( $wp_customize ) {
|
931
|
-
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
|
932
|
-
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
|
933
|
-
}
|
934
|
-
add_action( 'customize_register', 'starter_customize_register' );
|
935
|
-
|
936
|
-
/* SHORTCODES */
|
937
|
-
|
938
|
-
// Allow shortcodes in widgets
|
939
|
-
add_filter( 'widget_text', 'do_shortcode' );
|
940
|
-
|
941
|
-
/**
|
942
|
-
* The supported attributes for the shortcode are 'id', 'align', 'width', and 'caption'.
|
943
|
-
*
|
944
|
-
* @since [starter] 1.0
|
945
|
-
*/
|
946
|
-
function starter_shortcode_caption( $atts, $content = null ) {
|
947
|
-
extract(
|
948
|
-
shortcode_atts(
|
949
|
-
array(
|
950
|
-
'id' => '',
|
951
|
-
'align' => 'alignnone',
|
952
|
-
'width' => '',
|
953
|
-
'caption' => '',
|
954
|
-
), $atts
|
955
|
-
)
|
956
|
-
);
|
957
|
-
|
958
|
-
if ( 1 > ( int ) $width )
|
959
|
-
return $content;
|
960
|
-
|
961
|
-
if ( empty( $caption ) ) {
|
962
|
-
preg_match( '/(<img[^>]+>)[ ]?(.*)/i', $content, $match );
|
963
|
-
$content = $match[1];
|
964
|
-
$caption = $match[2];
|
965
|
-
}
|
966
|
-
|
967
|
-
if ( $id ) {
|
968
|
-
$idtag = 'id="' . esc_attr( $id ) . '" ';
|
969
|
-
}
|
970
|
-
|
971
|
-
$out[] = '<figure ' . $idtag . 'aria-describedby="figcaption_' . $id . '" class="post-image wp-caption ' . $align . '">';
|
972
|
-
$out[] = do_shortcode( $content );
|
973
|
-
$out[] = '<figcaption id="figcaption_' . $id . '" class="caption wp-caption-text">' . wpautop( wptexturize( $caption ) ) . '</figcaption>';
|
974
|
-
$out[] = '</figure>';
|
975
|
-
|
976
|
-
return implode( "\n", $out );
|
977
|
-
}
|
978
|
-
|
979
|
-
add_shortcode( 'wp_caption', 'starter_shortcode_caption' );
|
980
|
-
add_shortcode( 'caption', 'starter_shortcode_caption' );
|
981
|
-
|
982
|
-
|
983
|
-
/* ADMIN STUFF */
|
984
|
-
|
985
|
-
/**
|
986
|
-
* Remove unnecessary dashboard widgets
|
987
|
-
*
|
988
|
-
* @link http://www.deluxeblogtips.com/2011/01/remove-dashboard-widgets-in-wordpress.html
|
989
|
-
* @since [starter] 1.0
|
990
|
-
*/
|
991
|
-
function starter_remove_dashboard_widgets() {
|
992
|
-
// Incoming Links Widget
|
993
|
-
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
|
994
|
-
|
995
|
-
// Plugins Widget
|
996
|
-
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
|
997
|
-
|
998
|
-
remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );
|
999
|
-
remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
|
1000
|
-
|
1001
|
-
// Sitepress WPML Plugin Widget
|
1002
|
-
remove_meta_box( 'icl_dashboard_widget', 'dashboard', 'normal' );
|
1003
|
-
|
1004
|
-
// Yoast's SEO Plugin Widget
|
1005
|
-
remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal' );
|
1006
|
-
}
|
1007
|
-
|
1008
|
-
add_action( 'admin_init', 'starter_remove_dashboard_widgets' );
|
1009
|
-
|
1010
|
-
/**
|
1011
|
-
* Adds custom menu to admin bar
|
1012
|
-
*
|
1013
|
-
* @since [starter] 1.0
|
1014
|
-
*/
|
1015
|
-
function starter_bar_menu( $wp_admin_bar ) {
|
1016
|
-
if ( ! is_super_admin() or ! is_admin_bar_showing() )
|
1017
|
-
return;
|
34
|
+
/**
|
35
|
+
* Custom functions that act independently of the theme templates
|
36
|
+
*/
|
37
|
+
require( get_template_directory() . '/inc/extras.php' );
|
1018
38
|
|
1019
39
|
/**
|
1020
|
-
*
|
40
|
+
* Custom Theme Options
|
1021
41
|
*/
|
1022
|
-
//
|
1023
|
-
$my_account = $wp_admin_bar->get_node( 'my-account' );
|
1024
|
-
// change the "howdy"
|
1025
|
-
$my_account->title = str_replace( 'Howdy,', __( 'Hi,', 'starter' ), $my_account->title );
|
1026
|
-
// remove the original node
|
1027
|
-
$wp_admin_bar->remove_node( 'my-account' );
|
1028
|
-
// add back our modified version
|
1029
|
-
$wp_admin_bar->add_node( $my_account );
|
42
|
+
//require( get_template_directory() . '/inc/theme-options/theme-options.php' );
|
1030
43
|
|
1031
44
|
/**
|
1032
|
-
*
|
1033
|
-
*
|
45
|
+
* Make theme available for translation
|
46
|
+
* Translations can be filed in the /languages/ directory
|
47
|
+
* If you're building a theme based on starter, use a find and replace
|
48
|
+
* to change 'starter' to the name of your theme in all the template files
|
1034
49
|
*/
|
1035
|
-
|
50
|
+
load_theme_textdomain( 'starter', get_template_directory() . '/languages' );
|
1036
51
|
|
1037
52
|
/**
|
1038
|
-
*
|
1039
|
-
* First, just create the parent menu item
|
53
|
+
* Add default posts and comments RSS feed links to head
|
1040
54
|
*/
|
1041
|
-
|
1042
|
-
array(
|
1043
|
-
'id' => 'favorites',
|
1044
|
-
'parent' => 'top-secondary', // puts it on the right-hand side
|
1045
|
-
'title' => __( 'Favorites', 'starter' ),
|
1046
|
-
)
|
1047
|
-
);
|
55
|
+
add_theme_support( 'automatic-feed-links' );
|
1048
56
|
|
1049
57
|
/**
|
1050
|
-
*
|
1051
|
-
* This link goes to the All Settings page,
|
1052
|
-
* so only show it to users that have appropriate privileges
|
58
|
+
* Enable support for Post Thumbnails
|
1053
59
|
*/
|
1054
|
-
|
1055
|
-
$wp_admin_bar->add_menu(
|
1056
|
-
array(
|
1057
|
-
'id' => 'all-settings',
|
1058
|
-
'parent' => 'favorites',
|
1059
|
-
'title' => __( 'Options', 'starter' ),
|
1060
|
-
'href' => admin_url( 'options.php' ),
|
1061
|
-
)
|
1062
|
-
);
|
1063
|
-
}
|
60
|
+
add_theme_support( 'post-thumbnails' );
|
1064
61
|
|
1065
|
-
|
1066
|
-
|
1067
|
-
|
1068
|
-
|
1069
|
-
|
1070
|
-
|
1071
|
-
'href' => admin_url( 'edit.php?post_type=post&author=' . get_current_user_id() ),
|
1072
|
-
)
|
1073
|
-
);
|
62
|
+
/**
|
63
|
+
* This theme uses wp_nav_menu() in one location.
|
64
|
+
*/
|
65
|
+
register_nav_menus( array(
|
66
|
+
'primary' => __( 'Primary Menu', 'starter' ),
|
67
|
+
) );
|
1074
68
|
|
1075
|
-
|
1076
|
-
|
1077
|
-
|
1078
|
-
|
1079
|
-
'parent' => 'top-secondary', // puts it on the right-hand side
|
1080
|
-
'title' => get_num_queries() . 'Q - ' . timer_stop() . 's', // link title
|
1081
|
-
'href' => '#',
|
1082
|
-
'meta' => false,
|
1083
|
-
)
|
1084
|
-
);
|
69
|
+
/**
|
70
|
+
* Add support for the Aside Post Formats
|
71
|
+
*/
|
72
|
+
add_theme_support( 'post-formats', array( 'aside', ) );
|
1085
73
|
}
|
1086
|
-
|
1087
|
-
add_action( '
|
74
|
+
endif; // starter_setup
|
75
|
+
add_action( 'after_setup_theme', 'starter_setup' );
|
1088
76
|
|
1089
77
|
/**
|
1090
|
-
*
|
78
|
+
* Register widgetized area and update sidebar with default widgets
|
1091
79
|
*
|
1092
|
-
* @since
|
80
|
+
* @since starter 1.0
|
1093
81
|
*/
|
1094
|
-
function
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1098
|
-
|
1099
|
-
|
1100
|
-
|
1101
|
-
|
1102
|
-
|
1103
|
-
// Add Pinterest
|
1104
|
-
$contactmethods['user_pt'] = __( 'Pinterest', 'starter' );
|
1105
|
-
|
1106
|
-
// Add Twitter
|
1107
|
-
$contactmethods['user_tw'] = __( 'Twitter', 'starter' );
|
1108
|
-
|
1109
|
-
// Add Linkedin
|
1110
|
-
$contactmethods['user_lk'] = __( 'Linkedin', 'starter' );
|
1111
|
-
|
1112
|
-
// Add Github
|
1113
|
-
$contactmethods['user_gh'] = __( 'Github', 'starter' );
|
1114
|
-
|
1115
|
-
// Add Google+
|
1116
|
-
$contactmethods['google_profile'] = __( 'Google+ profile', 'starter' );
|
1117
|
-
|
1118
|
-
return $contactmethods;
|
82
|
+
function starter_widgets_init() {
|
83
|
+
register_sidebar( array(
|
84
|
+
'name' => __( 'Sidebar', 'starter' ),
|
85
|
+
'id' => 'sidebar-1',
|
86
|
+
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
|
87
|
+
'after_widget' => '</aside>',
|
88
|
+
'before_title' => '<h1 class="widget-title">',
|
89
|
+
'after_title' => '</h1>',
|
90
|
+
) );
|
1119
91
|
}
|
1120
|
-
|
1121
|
-
add_filter( 'user_contactmethods', 'starter_user_contactmethods' );
|
92
|
+
add_action( 'widgets_init', 'starter_widgets_init' );
|
1122
93
|
|
1123
94
|
/**
|
1124
|
-
*
|
1125
|
-
*
|
1126
|
-
* @since [starter] 1.0
|
95
|
+
* Enqueue scripts and styles
|
1127
96
|
*/
|
1128
|
-
function
|
1129
|
-
|
1130
|
-
global $post;
|
1131
|
-
|
1132
|
-
$args = array(
|
1133
|
-
'public' => true,
|
1134
|
-
'_builtin' => false,
|
1135
|
-
);
|
1136
|
-
$output = 'names'; // names or objects, note names is the default
|
1137
|
-
$operator = 'and'; // 'and' or 'or'
|
1138
|
-
|
1139
|
-
$post_types = get_post_types( $args, $output, $operator );
|
1140
|
-
|
1141
|
-
$post_types['post'] = 'post';
|
1142
|
-
$post_types['page'] = 'page';
|
97
|
+
function starter_scripts() {
|
98
|
+
wp_enqueue_style( 'style', get_stylesheet_uri() );
|
1143
99
|
|
1144
|
-
|
1145
|
-
$wtf = array( true, false );
|
1146
|
-
foreach ( $wtf as $prev ) {
|
1147
|
-
$p = get_adjacent_post( false, '', $prev );
|
100
|
+
wp_enqueue_script( 'small-menu', get_template_directory_uri() . '/javascripts/small-menu.js', array( 'jquery' ), '20120206', true );
|
1148
101
|
|
1149
|
-
|
1150
|
-
|
1151
|
-
jQuery(function($) {
|
1152
|
-
$(".wrap h2" )
|
1153
|
-
.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>\' );
|
1154
|
-
});
|
1155
|
-
</script>';
|
1156
|
-
}
|
1157
|
-
}
|
1158
|
-
}
|
102
|
+
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
|
103
|
+
wp_enqueue_script( 'comment-reply' );
|
1159
104
|
}
|
1160
|
-
}
|
1161
|
-
|
1162
|
-
add_action( 'admin_head', 'starter_add_navigation_edit_posts' );
|
1163
|
-
|
1164
|
-
/**
|
1165
|
-
* Custom Login Logo Support
|
1166
|
-
*
|
1167
|
-
* @since [starter] 1.0
|
1168
|
-
*/
|
1169
|
-
function starter_custom_login_logo() {
|
1170
|
-
echo '<style type="text/css">
|
1171
|
-
h1 a { background-image:url(' . get_template_directory_uri() . '/images/login-logo.png) !important; }
|
1172
|
-
</style>';
|
1173
|
-
}
|
1174
|
-
|
1175
|
-
add_action( 'login_head', 'starter_custom_login_logo' );
|
1176
|
-
|
1177
|
-
/**
|
1178
|
-
* Custom Login URL
|
1179
|
-
*
|
1180
|
-
* @since [starter] 1.0
|
1181
|
-
*/
|
1182
|
-
function starter_wp_login_url() {
|
1183
|
-
return home_url();
|
1184
|
-
}
|
1185
|
-
|
1186
|
-
add_filter( 'login_headerurl', 'starter_wp_login_url' );
|
1187
105
|
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
* @since [starter] 1.0
|
1192
|
-
*/
|
1193
|
-
function starter_wp_login_title() {
|
1194
|
-
return get_option( 'blogname' );
|
106
|
+
if ( is_singular() && wp_attachment_is_image() ) {
|
107
|
+
wp_enqueue_script( 'keyboard-image-navigation', get_template_directory_uri() . '/javascripts/keyboard-image-navigation.js', array( 'jquery' ), '20120202' );
|
108
|
+
}
|
1195
109
|
}
|
1196
|
-
|
1197
|
-
add_filter( 'login_headertitle', 'starter_wp_login_title' );
|
110
|
+
add_action( 'wp_enqueue_scripts', 'starter_scripts' );
|
1198
111
|
|
1199
112
|
/**
|
1200
|
-
* Custom
|
1201
|
-
*
|
1202
|
-
* @since [starter] 1.0
|
113
|
+
* Implement the Custom Header feature
|
1203
114
|
*/
|
1204
|
-
|
1205
|
-
$credits = '<span id="footer-thankyou">Crafted by <a href="//alexsancho.name" target="_blank">Alex Sancho</a></span>.';
|
1206
|
-
|
1207
|
-
echo apply_filters( 'starter_custom_admin_footer', $credits );
|
1208
|
-
}
|
1209
|
-
|
1210
|
-
// adding it to the admin area
|
1211
|
-
add_filter( 'admin_footer_text', 'starter_custom_admin_footer' );
|
115
|
+
//require( get_template_directory() . '/inc/custom-header.php' );
|