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
@@ -0,0 +1,29 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* The default template for displaying footer
|
4
|
+
*
|
5
|
+
* @category Theme
|
6
|
+
* @package [foundation]
|
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 twelve mobile-four columns" role="contentinfo">
|
16
|
+
<?php do_action( 'foundation_footer' ); ?>
|
17
|
+
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'foundation' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'foundation' ); ?>"><?php printf( __( 'Proudly powered by %s', 'foundation' ), '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,1425 @@
|
|
1
|
+
<?php
|
2
|
+
/**
|
3
|
+
* [foundation] 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 [foundation]
|
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 foundation_setup() in a child theme, add your own foundation_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 [foundation] 1.0
|
42
|
+
*/
|
43
|
+
function foundation_setup() {
|
44
|
+
// SET THEME LANGUAGES DIRECTORY
|
45
|
+
// Theme translations can be filed in the my_theme/languages/ directory
|
46
|
+
load_theme_textdomain( 'foundation', 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', 'foundation' ) );
|
64
|
+
|
65
|
+
/* Options Framework */
|
66
|
+
locate_template( 'options.php', true );
|
67
|
+
locate_template( 'admin/index.php', true );
|
68
|
+
|
69
|
+
do_action( 'foundation_setup' );
|
70
|
+
}
|
71
|
+
|
72
|
+
add_action( 'after_setup_theme', 'foundation_setup' );
|
73
|
+
|
74
|
+
/**
|
75
|
+
* Some cleanup
|
76
|
+
*
|
77
|
+
* @since [foundation] 1.0
|
78
|
+
* @return void
|
79
|
+
*/
|
80
|
+
function foundation_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', 'foundation_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 [foundation] 1.0
|
144
|
+
* @return void
|
145
|
+
*/
|
146
|
+
function foundation_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.foundation.js', false, '2.6.2' );
|
162
|
+
|
163
|
+
// Foundation scripts
|
164
|
+
|
165
|
+
/* Minified */
|
166
|
+
// wp_enqueue_script( 'foundation', get_template_directory_uri() . '/assets/js/libs/foundation.min.js', array( 'jquery' ), '3.0', true );
|
167
|
+
|
168
|
+
/* Unminified */
|
169
|
+
wp_enqueue_script( 'mediaquery', get_template_directory_uri() . '/javascripts/jquery.foundation.mediaQueryToggle.js', array( 'jquery' ), '3.0', true );
|
170
|
+
wp_enqueue_script( 'forms', get_template_directory_uri() . '/javascripts/jquery.foundation.forms.js', array( 'jquery' ), '3.0', true );
|
171
|
+
wp_enqueue_script( 'reveal', get_template_directory_uri() . '/javascripts/jquery.foundation.reveal.js', array( 'jquery' ), '3.0', true );
|
172
|
+
wp_enqueue_script( 'orbit', get_template_directory_uri() . '/javascripts/jquery.foundation.orbit.js', array( 'jquery' ), '3.0', true );
|
173
|
+
wp_enqueue_script( 'navigation', get_template_directory_uri() . '/javascripts/jquery.foundation.navigation.js', array( 'jquery' ), '3.0', true );
|
174
|
+
wp_enqueue_script( 'buttons', get_template_directory_uri() . '/javascripts/jquery.foundation.buttons.js', array( 'jquery' ), '3.0', true );
|
175
|
+
wp_enqueue_script( 'tabs', get_template_directory_uri() . '/javascripts/jquery.foundation.tabs.js', array( 'jquery' ), '3.0', true );
|
176
|
+
wp_enqueue_script( 'tooltips', get_template_directory_uri() . '/javascripts/jquery.foundation.tooltips.js', array( 'jquery' ), '3.0', true );
|
177
|
+
wp_enqueue_script( 'accordion', get_template_directory_uri() . '/javascripts/jquery.foundation.accordion.js', array( 'jquery' ), '3.0', true );
|
178
|
+
wp_enqueue_script( 'placeholder', get_template_directory_uri() . '/javascripts/jquery.placeholder.js', array( 'jquery' ), '3.0', true );
|
179
|
+
wp_enqueue_script( 'alerts', get_template_directory_uri() . '/javascripts/jquery.foundation.alerts.js', array( 'jquery' ), '3.0', true );
|
180
|
+
wp_enqueue_script( 'topbar', get_template_directory_uri() . '/javascripts/jquery.foundation.topbar.js', array( 'jquery' ), '3.0', true );
|
181
|
+
wp_enqueue_script( 'clearing', get_template_directory_uri() . '/javascripts/jquery.foundation.clearing.js', array( 'jquery' ), '3.0', true );
|
182
|
+
|
183
|
+
wp_enqueue_script( 'app', get_template_directory_uri() . '/javascripts/app.js', array( 'jquery' ), $version, true );
|
184
|
+
}
|
185
|
+
|
186
|
+
add_action( 'wp_enqueue_scripts', 'foundation_enqueue_scripts' );
|
187
|
+
|
188
|
+
/**
|
189
|
+
* Adds custom styles to theme header
|
190
|
+
*
|
191
|
+
* @since [foundation] 1.0
|
192
|
+
* @return void
|
193
|
+
*/
|
194
|
+
function foundation_enqueue_styles() {
|
195
|
+
$theme = wp_get_theme();
|
196
|
+
$version = $theme['Version'];
|
197
|
+
|
198
|
+
wp_enqueue_style( 'fc-webicons', get_template_directory_uri() . '/stylesheets/fc-webicons.css', false, '2.0', 'all' );
|
199
|
+
|
200
|
+
wp_enqueue_style( 'app', get_stylesheet_uri(), false, $version, 'all' );
|
201
|
+
}
|
202
|
+
|
203
|
+
add_action( 'wp_enqueue_scripts', 'foundation_enqueue_styles' );
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Makes some changes to the <title> tag, by filtering the output of wp_title().
|
207
|
+
*
|
208
|
+
* If we have a site description and we're viewing the home page or a blog posts
|
209
|
+
* page (when using a static front page), then we will add the site description.
|
210
|
+
*
|
211
|
+
* If we're viewing a search result, then we're going to recreate the title entirely.
|
212
|
+
* We're going to add page numbers to all titles as well, to the middle of a search
|
213
|
+
* result title and the end of all other titles.
|
214
|
+
*
|
215
|
+
* The site title also gets added to all titles.
|
216
|
+
*
|
217
|
+
* @since [foundation] 1.0
|
218
|
+
*
|
219
|
+
* @param string $title Title generated by wp_title()
|
220
|
+
* @param string $separator The separator passed to wp_title(). Base theme uses a vertical bar, "|", as a separator in header.php.
|
221
|
+
* @return string The new title, ready for the <title> tag.
|
222
|
+
*/
|
223
|
+
function foundation_filter_wp_title( $title, $separator ) {
|
224
|
+
// Don't affect wp_title() calls in feeds.
|
225
|
+
if ( is_feed() or function_exists( 'get_wpseo_options' ) )
|
226
|
+
return $title;
|
227
|
+
|
228
|
+
// The $paged global variable contains the page number of a listing of posts.
|
229
|
+
// The $page global variable contains the page number of a single post that is paged.
|
230
|
+
// We'll display whichever one applies, if we're not looking at the first page.
|
231
|
+
global $paged, $page, $post;
|
232
|
+
|
233
|
+
if ( is_search() ) {
|
234
|
+
// If we're a search, let's start over:
|
235
|
+
$title = sprintf( __( 'Search results for %s', 'foundation' ), '"' . get_search_query() . '"' );
|
236
|
+
// Add a page number if we're on page 2 or more:
|
237
|
+
if ( $paged >= 2 ) {
|
238
|
+
$title .= " $separator " . sprintf( __( 'Page %s', 'foundation' ), $paged );
|
239
|
+
}
|
240
|
+
// Add the site name to the end:
|
241
|
+
$title .= " $separator " . get_bloginfo( 'name', 'display' );
|
242
|
+
// We're done. Let's send the new title back to wp_title():
|
243
|
+
return $title;
|
244
|
+
}
|
245
|
+
|
246
|
+
$return = array();
|
247
|
+
|
248
|
+
if ( $title != '' ) {
|
249
|
+
$return[] = str_replace( " $separator ", '', apply_filters( 'the_category', $title ) );
|
250
|
+
}
|
251
|
+
|
252
|
+
if ( is_single() ) {
|
253
|
+
if ( get_post_meta( $post->ID, 'title', true ) ) {
|
254
|
+
$return[] = stripslashes( get_post_meta( $post->ID, 'seo_title', true ) );
|
255
|
+
}
|
256
|
+
elseif ( ! in_array( $post->post_type, array( 'post', 'page', 'attachment' ) ) ) {
|
257
|
+
$post_type_obj = get_post_type_object( $post->post_type );
|
258
|
+
$return[] = apply_filters( 'post_type_archive_title', $post_type_obj->labels->name );
|
259
|
+
}
|
260
|
+
}
|
261
|
+
|
262
|
+
// Add a page number if necessary:
|
263
|
+
if ( $paged >= 2 or $page >= 2 ) {
|
264
|
+
$return[] = sprintf( __( 'Page %s', 'foundation' ), max( $paged, $page ) );
|
265
|
+
}
|
266
|
+
|
267
|
+
// Add the site name to the end:
|
268
|
+
$return[] = get_bloginfo( 'name', 'display' );
|
269
|
+
|
270
|
+
// If we have a site description and we're on the home/front page, add the description:
|
271
|
+
$site_description = get_bloginfo( 'description', 'display' );
|
272
|
+
if ( $site_description and ( is_home() or is_front_page() ) ) {
|
273
|
+
$return[] = $site_description;
|
274
|
+
}
|
275
|
+
|
276
|
+
// Return the new title to wp_title():
|
277
|
+
return implode( " $separator ", $return );
|
278
|
+
}
|
279
|
+
|
280
|
+
add_filter( 'wp_title', 'foundation_filter_wp_title', 10, 3 );
|
281
|
+
|
282
|
+
/**
|
283
|
+
* Adds code to header
|
284
|
+
*
|
285
|
+
* @since [foundation] 1.0
|
286
|
+
* @return string misc
|
287
|
+
*/
|
288
|
+
function foundation_header() {
|
289
|
+
?>
|
290
|
+
<!-- For third-generation iPad with high-resolution Retina display: -->
|
291
|
+
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="apple-touch-icon-144x144-precomposed.png?1333401433">
|
292
|
+
<!-- For iPhone with high-resolution Retina display: -->
|
293
|
+
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-touch-icon-114x114-precomposed.png?1333401433">
|
294
|
+
<!-- For first- and second-generation iPad: -->
|
295
|
+
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="apple-touch-icon-72x72-precomposed.png?1333401433">
|
296
|
+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
297
|
+
<link rel="apple-touch-icon-precomposed" href="apple-touch-icon-precomposed.png?1333401433">
|
298
|
+
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
|
299
|
+
<link rel="shortcut icon" href="favicon.ico?1333401433" type="image/x-icon" />
|
300
|
+
<?php
|
301
|
+
do_action( 'foundation_header' );
|
302
|
+
}
|
303
|
+
|
304
|
+
add_action( 'wp_head', 'foundation_header', 10 );
|
305
|
+
|
306
|
+
/**
|
307
|
+
* Adds code to footer
|
308
|
+
*
|
309
|
+
* @since [foundation] 1.0
|
310
|
+
* @return string misc
|
311
|
+
*/
|
312
|
+
function foundation_footer() {}
|
313
|
+
|
314
|
+
add_action( 'wp_footer', 'foundation_footer', 10 );
|
315
|
+
|
316
|
+
/**
|
317
|
+
* Defines widget areas
|
318
|
+
*
|
319
|
+
* @since [foundation] 1.0
|
320
|
+
* @return void
|
321
|
+
*/
|
322
|
+
function foundation_widgets_init() {
|
323
|
+
register_sidebar(
|
324
|
+
array(
|
325
|
+
'name' => __( 'Primary widget area', 'foundation' ),
|
326
|
+
'id' => 'primary-widget-area',
|
327
|
+
'description' => __( '', 'foundation' ),
|
328
|
+
'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
|
329
|
+
'after_widget' => '</li>',
|
330
|
+
'before_title' => '<h3 class="widget-title">',
|
331
|
+
'after_title' => '</h3>',
|
332
|
+
)
|
333
|
+
);
|
334
|
+
}
|
335
|
+
|
336
|
+
add_action( 'widgets_init', 'foundation_widgets_init' );
|
337
|
+
|
338
|
+
/**
|
339
|
+
* Clean up output of stylesheet <link> tags
|
340
|
+
*
|
341
|
+
* @since [foundation] 1.0
|
342
|
+
*/
|
343
|
+
function foundation_clean_style_tag( $input ) {
|
344
|
+
preg_match_all( "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", $input, $matches );
|
345
|
+
// Only display media if it's print
|
346
|
+
$media = $matches[3][0] == 'print' ? ' media="print"' : '';
|
347
|
+
|
348
|
+
return '<link rel="stylesheet" href="' . $matches[ 2 ][ 0 ] . '"' . $media . '>' . "\n";
|
349
|
+
}
|
350
|
+
|
351
|
+
add_filter( 'style_loader_tag', 'foundation_clean_style_tag' );
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Remove unnecessary self-closing tags
|
355
|
+
*
|
356
|
+
* @since [foundation] 1.0
|
357
|
+
*/
|
358
|
+
function foundation_remove_self_closing_tags( $input ) {
|
359
|
+
return str_replace( ' />', '>', $input );
|
360
|
+
}
|
361
|
+
|
362
|
+
add_filter( 'get_avatar', 'foundation_remove_self_closing_tags' ); // <img />
|
363
|
+
add_filter( 'comment_id_fields', 'foundation_remove_self_closing_tags' ); // <input />
|
364
|
+
add_filter( 'post_thumbnail_html', 'foundation_remove_self_closing_tags' ); // <img />
|
365
|
+
|
366
|
+
/**
|
367
|
+
* Wrap embedded media as suggested by Readability
|
368
|
+
*
|
369
|
+
* @link https://gist.github.com/965956
|
370
|
+
* @link http://www.readability.com/publishers/guidelines#publisher
|
371
|
+
* @since [foundation] 1.0
|
372
|
+
*/
|
373
|
+
function foundation_embed_wrap( $cache, $url, $attr = '', $post_ID = '' ) {
|
374
|
+
return '<div class="entry-content-asset">' . $cache . '</div>';
|
375
|
+
}
|
376
|
+
|
377
|
+
add_filter( 'embed_oembed_html', 'foundation_embed_wrap', 10, 4 );
|
378
|
+
add_filter( 'embed_googlevideo', 'foundation_embed_wrap', 10, 2 );
|
379
|
+
|
380
|
+
/**
|
381
|
+
* Remove height/width attributes on images so they can be responsive
|
382
|
+
*
|
383
|
+
* @since [foundation] 1.0
|
384
|
+
*/
|
385
|
+
function foundation_remove_thumbnail_dimensions( $html, $id, $alt, $title ) {
|
386
|
+
return preg_replace(
|
387
|
+
array(
|
388
|
+
'/\s+width="\d+"/i',
|
389
|
+
'/\s+height="\d+"/i',
|
390
|
+
'/alt=""/i',
|
391
|
+
),
|
392
|
+
array(
|
393
|
+
'',
|
394
|
+
'',
|
395
|
+
'',
|
396
|
+
'alt="' . $title . '"',
|
397
|
+
),
|
398
|
+
$html
|
399
|
+
);
|
400
|
+
}
|
401
|
+
|
402
|
+
add_filter( 'post_thumbnail_html', 'foundation_remove_thumbnail_dimensions', 10, 4 );
|
403
|
+
add_filter( 'image_send_to_editor', 'foundation_remove_thumbnail_dimensions', 10, 4 );
|
404
|
+
add_filter( 'get_image_tag', 'foundation_remove_thumbnail_dimensions', 10, 4 );
|
405
|
+
add_filter( 'foundation_shortcode_caption_content', 'foundation_remove_thumbnail_dimensions', 10, 4 );
|
406
|
+
|
407
|
+
/**
|
408
|
+
* Clean the output of attributes of images in editor.
|
409
|
+
*
|
410
|
+
* @link http://www.sitepoint.com/wordpress-change-img-tag-html/
|
411
|
+
* @since [foundation] 1.0
|
412
|
+
*/
|
413
|
+
function foundation_image_tag_class( $class, $id, $align, $size ) {
|
414
|
+
$align = 'align' . esc_attr( $align );
|
415
|
+
return $align;
|
416
|
+
}
|
417
|
+
|
418
|
+
add_filter( 'get_image_tag_class', 'foundation_image_tag_class', 0, 4 );
|
419
|
+
|
420
|
+
/**
|
421
|
+
* Add thumbnail class to thumbnail links
|
422
|
+
*
|
423
|
+
* @since [foundation] 1.0
|
424
|
+
*/
|
425
|
+
function foundation_add_class_attachment_link( $html ) {
|
426
|
+
$postid = get_the_ID();
|
427
|
+
$html = str_replace( '<a', '<a class="th"', $html );
|
428
|
+
|
429
|
+
return $html;
|
430
|
+
}
|
431
|
+
|
432
|
+
add_filter( 'wp_get_attachment_link', 'foundation_add_class_attachment_link', 10, 1 );
|
433
|
+
add_filter( 'foundation_shortcode_caption_content', 'foundation_add_class_attachment_link', 10, 1 );
|
434
|
+
|
435
|
+
/**
|
436
|
+
* Filter in a link to a content ID attribute for the next/previous image links on image attachment pages
|
437
|
+
*
|
438
|
+
* @since [foundation] 1.0
|
439
|
+
*/
|
440
|
+
function foundation_enhanced_image_navigation( $url, $id ) {
|
441
|
+
if ( ! is_attachment() && ! wp_attachment_is_image( $id ) )
|
442
|
+
return $url;
|
443
|
+
|
444
|
+
$image = get_post( $id );
|
445
|
+
if ( ! empty( $image->post_parent ) && $image->post_parent != $id )
|
446
|
+
$url .= '#main';
|
447
|
+
|
448
|
+
return $url;
|
449
|
+
}
|
450
|
+
|
451
|
+
add_filter( 'attachment_link', 'foundation_enhanced_image_navigation', 10, 2 );
|
452
|
+
|
453
|
+
/**
|
454
|
+
* Replace various active menu class names with "active"
|
455
|
+
* Remove the id="" on nav menu items
|
456
|
+
* Return 'menu-slug' for nav menu classes
|
457
|
+
*
|
458
|
+
* @since [foundation] 1.0
|
459
|
+
*/
|
460
|
+
function foundation_wp_nav_menu_class( $classes, $item ) {
|
461
|
+
$slug = sanitize_title( $item->title );
|
462
|
+
$classes = preg_replace( '/(current(-menu-|[-_]page[-_])(item|parent|ancestor))/', 'active', $classes );
|
463
|
+
$classes = preg_replace( '/^((menu|page)[-_\w+]+)+/', '', $classes );
|
464
|
+
|
465
|
+
$classes[] = 'menu-' . $slug;
|
466
|
+
|
467
|
+
return array_filter( array_unique( $classes ), 'is_element_empty' );
|
468
|
+
}
|
469
|
+
|
470
|
+
add_filter( 'nav_menu_css_class', 'foundation_wp_nav_menu_class', 10, 2 );
|
471
|
+
add_filter( 'nav_menu_item_id', '__return_null' );
|
472
|
+
|
473
|
+
/**
|
474
|
+
* Check if $element is empty
|
475
|
+
*
|
476
|
+
* @since [foundation] 1.0
|
477
|
+
*/
|
478
|
+
function is_element_empty( $element ) {
|
479
|
+
$element = trim( $element );
|
480
|
+
|
481
|
+
return ( bool ) ! empty( $element );
|
482
|
+
}
|
483
|
+
|
484
|
+
/**
|
485
|
+
* Create a graceful fallback to wp_page_menu
|
486
|
+
*
|
487
|
+
* @since [foundation] 1.0
|
488
|
+
*/
|
489
|
+
function foundation_page_menu() {
|
490
|
+
$args = array(
|
491
|
+
'sort_column' => 'menu_order, post_title',
|
492
|
+
'menu_class' => 'side-nav two mobile-four columns',
|
493
|
+
'include' => '',
|
494
|
+
'exclude' => '',
|
495
|
+
'echo' => true,
|
496
|
+
'show_home' => false,
|
497
|
+
'link_before' => '',
|
498
|
+
'link_after' => '',
|
499
|
+
);
|
500
|
+
|
501
|
+
wp_page_menu( $args );
|
502
|
+
}
|
503
|
+
|
504
|
+
/**
|
505
|
+
* Navigation Menu Adjustments
|
506
|
+
*
|
507
|
+
* @since [foundation] 1.0
|
508
|
+
*/
|
509
|
+
class Foundation_Navigation extends Walker_Nav_Menu {
|
510
|
+
function start_lvl( &$output, $depth ) {
|
511
|
+
$indent = str_repeat( "\t", $depth );
|
512
|
+
$output .= "\n$indent<ul class=\"flyout\">\n";
|
513
|
+
}
|
514
|
+
|
515
|
+
function display_element( $element, &$children_elements, $max_depth, $depth = 0, $args, &$output ) {
|
516
|
+
$id_field = $this->db_fields['id'];
|
517
|
+
if ( ! empty( $children_elements[ $element->$id_field ] ) ) {
|
518
|
+
$element->classes[] = 'has-flyout';
|
519
|
+
}
|
520
|
+
Walker_Nav_Menu::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
|
521
|
+
}
|
522
|
+
}
|
523
|
+
|
524
|
+
/**
|
525
|
+
* Adds extra info to language attributes string
|
526
|
+
*
|
527
|
+
* @since [foundation] 1.0
|
528
|
+
*/
|
529
|
+
function foundation_language_attributes() {
|
530
|
+
$attr = array();
|
531
|
+
$output = '';
|
532
|
+
|
533
|
+
if ( function_exists( 'is_rtl' ) ) {
|
534
|
+
if ( is_rtl() == 'rtl' ) {
|
535
|
+
$attr[] = 'dir="rtl"';
|
536
|
+
}
|
537
|
+
}
|
538
|
+
|
539
|
+
$lang = get_bloginfo( 'language' );
|
540
|
+
|
541
|
+
if ( $lang and $lang !== 'en-US' ) {
|
542
|
+
$attr[] = "lang=\"$lang\"";
|
543
|
+
}
|
544
|
+
else {
|
545
|
+
$attr[] = 'lang="en"';
|
546
|
+
}
|
547
|
+
|
548
|
+
return implode( ' ', $attr );
|
549
|
+
}
|
550
|
+
|
551
|
+
add_filter( 'language_attributes', 'foundation_language_attributes' );
|
552
|
+
|
553
|
+
/**
|
554
|
+
* remove the p from around imgs
|
555
|
+
*
|
556
|
+
* @link https://gist.github.com/975026
|
557
|
+
* @since [foundation] 1.0
|
558
|
+
*/
|
559
|
+
function foundation_filter_ptags_on_images( $content ) {
|
560
|
+
// Replace br tags inside figures
|
561
|
+
$content = preg_replace( '/(<figure .*>)?<br\s?\/?>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*/iU', '\1\2\3\4', $content );
|
562
|
+
// do a regular expression replace...
|
563
|
+
// find all p tags that have just
|
564
|
+
// <p>maybe some white space<img all stuff up to /> then maybe whitespace </p>
|
565
|
+
// replace it with just the image tag...
|
566
|
+
$content = preg_replace( '/<p>\s*(<a .*>)?\s*(<img .* \/>)\s*(<\/a>)?\s*<\/p>/iU', '\1\2\3', $content );
|
567
|
+
// now pass that through and do the same for iframes...
|
568
|
+
return preg_replace( '/<p>\s*(<iframe .*>*.<\/iframe>)\s*<\/p>/iU', '\1', $content );
|
569
|
+
}
|
570
|
+
|
571
|
+
add_filter( 'the_content', 'foundation_filter_ptags_on_images' );
|
572
|
+
|
573
|
+
/**
|
574
|
+
* Adds browser detection body class
|
575
|
+
* Adds extra classes to body tag on custom taxonomies
|
576
|
+
*
|
577
|
+
* @since [foundation] 1.0
|
578
|
+
*/
|
579
|
+
function foundation_body_classes( $classes ) {
|
580
|
+
global $wp_query, $is_lynx, $is_gecko, $is_IE, $is_opera, $is_NS4, $is_safari, $is_chrome, $is_iphone;
|
581
|
+
|
582
|
+
if ( isset( $wp_query->query_vars['taxonomy'] ) or isset( $wp_query->query_vars['term'] ) ) {
|
583
|
+
array_push( $classes, 'custom-taxonomy-archive', 'custom-taxonomy-' . ( isset( $wp_query->query_vars[ 'taxonomy' ] ) ? get_query_var( 'taxonomy' ) : get_query_var( 'term' ) ) . '-archive' );
|
584
|
+
}
|
585
|
+
|
586
|
+
if ( $is_lynx ) $classes[] = 'lynx';
|
587
|
+
elseif ( $is_gecko ) $classes[] = 'gecko';
|
588
|
+
elseif ( $is_opera ) $classes[] = 'opera';
|
589
|
+
elseif ( $is_NS4 ) $classes[] = 'ns4';
|
590
|
+
elseif ( $is_safari ) $classes[] = 'safari';
|
591
|
+
elseif ( $is_chrome ) $classes[] = 'chrome';
|
592
|
+
elseif ( $is_IE ) $classes[] = 'ie';
|
593
|
+
else $classes[] = 'unknown';
|
594
|
+
|
595
|
+
if ( $is_iphone ) $classes[] = 'iphone';
|
596
|
+
|
597
|
+
// Add post/page slug
|
598
|
+
if ( is_single() or is_page() and ! is_front_page() ) {
|
599
|
+
$classes[] = basename( get_permalink() );
|
600
|
+
}
|
601
|
+
|
602
|
+
// Remove unnecessary classes
|
603
|
+
$home_id_class = 'page-id-' . get_option( 'page_on_front' );
|
604
|
+
$remove_classes = array(
|
605
|
+
'page-template-default',
|
606
|
+
$home_id_class,
|
607
|
+
);
|
608
|
+
|
609
|
+
$classes = array_diff( $classes, $remove_classes );
|
610
|
+
|
611
|
+
return $classes;
|
612
|
+
}
|
613
|
+
|
614
|
+
add_filter( 'body_class', 'foundation_body_classes' );
|
615
|
+
|
616
|
+
/**
|
617
|
+
* Modifies output of custom post formats.
|
618
|
+
*
|
619
|
+
* @since [foundation] 1.0
|
620
|
+
*/
|
621
|
+
function foundation_custom_content( $content ) {
|
622
|
+
/* Check if we're displaying a 'quote' post. */
|
623
|
+
if ( has_post_format( 'quote' ) ) {
|
624
|
+
/* Match any <blockquote> elements. */
|
625
|
+
preg_match( '/<blockquote.*?>/', $content, $matches );
|
626
|
+
|
627
|
+
/* If no <blockquote> elements were found, wrap the entire content in one. */
|
628
|
+
if ( empty( $matches ) ) {
|
629
|
+
$content = "<blockquote>{$content}</blockquote>";
|
630
|
+
}
|
631
|
+
}
|
632
|
+
elseif ( has_post_format( 'aside' ) and ! is_singular() ) {
|
633
|
+
preg_match( '/<p>(.*?)<\/p>(?!\s*<p>)/', $content, $matches );
|
634
|
+
|
635
|
+
$content = str_replace( $matches[1], $matches[1] . ' <a href="' . get_permalink() . '">∞</a>', $content );
|
636
|
+
}
|
637
|
+
|
638
|
+
return $content;
|
639
|
+
}
|
640
|
+
|
641
|
+
add_filter( 'the_content', 'foundation_custom_content' );
|
642
|
+
|
643
|
+
/**
|
644
|
+
* Remove <p> and <br /> in the shortcodes
|
645
|
+
*
|
646
|
+
* @since [foundation] 1.0
|
647
|
+
*/
|
648
|
+
function foundation_shortcode_empty_paragraph_fix( $content ) {
|
649
|
+
$array = array(
|
650
|
+
'<p>[' => '[',
|
651
|
+
']</p>' => ']',
|
652
|
+
']<br />' => ']',
|
653
|
+
);
|
654
|
+
|
655
|
+
// replace the strings in the $content
|
656
|
+
$content = strtr( $content, $array );
|
657
|
+
|
658
|
+
return $content;
|
659
|
+
}
|
660
|
+
|
661
|
+
add_filter( 'the_content', 'foundation_shortcode_empty_paragraph_fix' );
|
662
|
+
|
663
|
+
/**
|
664
|
+
* Prints HTML with meta information for current post: categories, tags, permalink, author, and date.
|
665
|
+
*
|
666
|
+
* Create your own foundation_entry_meta() to override in a child theme.
|
667
|
+
*
|
668
|
+
* @since [foundation] 1.0
|
669
|
+
*/
|
670
|
+
function foundation_entry_meta() {
|
671
|
+
// Translators: used between list items, there is a space after the comma.
|
672
|
+
$categories_list = get_the_category_list( __( ', ', 'foundation' ) );
|
673
|
+
|
674
|
+
// Translators: used between list items, there is a space after the comma.
|
675
|
+
$tag_list = get_the_tag_list( '', __( ', ', 'foundation' ) );
|
676
|
+
|
677
|
+
$date = sprintf(
|
678
|
+
'<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s" pubdate>%4$s</time></a>',
|
679
|
+
esc_url( get_permalink() ),
|
680
|
+
esc_attr( get_the_time() ),
|
681
|
+
esc_attr( get_the_date( 'c' ) ),
|
682
|
+
esc_html( get_the_date() )
|
683
|
+
);
|
684
|
+
|
685
|
+
$author = sprintf(
|
686
|
+
'<span class="author vcard"><a class="url fn n" href="%1$s" title="%2$s" rel="author">%3$s</a></span>',
|
687
|
+
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
|
688
|
+
esc_attr( sprintf( __( 'View all posts by %s', 'foundation' ), get_the_author() ) ),
|
689
|
+
get_the_author()
|
690
|
+
);
|
691
|
+
|
692
|
+
// Translators: 1 is category, 2 is tag, 3 is the date and 4 is the author's name.
|
693
|
+
if ( $tag_list ) {
|
694
|
+
$utility_text = __( 'This entry was posted in %1$s and tagged %2$s on %3$s<span class="by-author"> by %4$s</span>.', 'foundation' );
|
695
|
+
}
|
696
|
+
elseif ( $categories_list ) {
|
697
|
+
$utility_text = __( 'This entry was posted in %1$s on %3$s<span class="by-author"> by %4$s</span>.', 'foundation' );
|
698
|
+
}
|
699
|
+
else {
|
700
|
+
$utility_text = __( 'This entry was posted on %3$s<span class="by-author"> by %4$s</span>.', 'foundation' );
|
701
|
+
}
|
702
|
+
|
703
|
+
printf(
|
704
|
+
$utility_text,
|
705
|
+
$categories_list,
|
706
|
+
$tag_list,
|
707
|
+
$date,
|
708
|
+
$author
|
709
|
+
);
|
710
|
+
}
|
711
|
+
|
712
|
+
/**
|
713
|
+
* Returns a "Continue Reading" link for excerpts
|
714
|
+
*
|
715
|
+
* @since [foundation] 1.0
|
716
|
+
*/
|
717
|
+
function foundation_continue_reading_link() {
|
718
|
+
$read_more_link = ' <a href="' . get_permalink() . '" class="more-link">' . __( 'Continue reading', 'foundation' ) . '</a>';
|
719
|
+
|
720
|
+
return $read_more_link;
|
721
|
+
}
|
722
|
+
|
723
|
+
/**
|
724
|
+
* Replaces "[...]" (appended to automatically generated excerpts ) with foundation_continue_reading_link().
|
725
|
+
*
|
726
|
+
* To override this in a child theme, remove the filter and add your own
|
727
|
+
* function tied to the excerpt_more filter hook.
|
728
|
+
*
|
729
|
+
* @since [foundation] 1.0
|
730
|
+
*/
|
731
|
+
function foundation_auto_excerpt_more( $more ) {
|
732
|
+
return foundation_continue_reading_link();
|
733
|
+
}
|
734
|
+
|
735
|
+
add_filter( 'excerpt_more', 'foundation_auto_excerpt_more' );
|
736
|
+
add_filter( 'the_content_more_link', 'foundation_auto_excerpt_more' );
|
737
|
+
|
738
|
+
/**
|
739
|
+
* Adds a pretty "Continue Reading" link to custom post excerpts.
|
740
|
+
*
|
741
|
+
* To override this link in a child theme, remove the filter and add your own
|
742
|
+
* function tied to the get_the_excerpt filter hook.
|
743
|
+
*
|
744
|
+
* @since [foundation] 1.0
|
745
|
+
*/
|
746
|
+
function foundation_custom_excerpt_more( $output ) {
|
747
|
+
if ( has_excerpt() and ! is_attachment() ) {
|
748
|
+
$output .= foundation_continue_reading_link();
|
749
|
+
}
|
750
|
+
return $output;
|
751
|
+
}
|
752
|
+
|
753
|
+
add_filter( 'get_the_excerpt', 'foundation_custom_excerpt_more' );
|
754
|
+
|
755
|
+
/**
|
756
|
+
* Adds nofollow rel atribute to content links
|
757
|
+
*
|
758
|
+
* @since [foundation] 1.0
|
759
|
+
*/
|
760
|
+
function foundation_nofollow_links_in_post( $text ) {
|
761
|
+
global $post;
|
762
|
+
|
763
|
+
if ( get_post_meta( $post->ID, 'nofollow_links', true ) ) {
|
764
|
+
preg_match_all( '/<a.*? href=\"(.*? )\".*?>(.*? )<\/a>/i', $text, $links );
|
765
|
+
$match_count = count( $links[0] );
|
766
|
+
|
767
|
+
for ( $i = 0; $i < $match_count; ++$i ) {
|
768
|
+
if ( ! preg_match( '/rel=[\"\']*nofollow[\"\']*/', $links[0][$i] ) ) {
|
769
|
+
preg_match_all( '/<a.*? href=\"(.*? )\"(.*? )>(.*? )<\/a>/i', $links[0][$i], $link_text );
|
770
|
+
|
771
|
+
$search = '>'.$link_text[3][0].'</a>';
|
772
|
+
$replace = ' rel="nofollow">'.$link_text[3][0].'</a>';
|
773
|
+
|
774
|
+
$text = str_replace( $search, $replace, $text );
|
775
|
+
}
|
776
|
+
}
|
777
|
+
}
|
778
|
+
|
779
|
+
return $text;
|
780
|
+
}
|
781
|
+
|
782
|
+
add_action( 'the_content', 'foundation_nofollow_links_in_post' );
|
783
|
+
|
784
|
+
/**
|
785
|
+
* Custom tag clould args
|
786
|
+
*
|
787
|
+
* @since [foundation] 1.0
|
788
|
+
*/
|
789
|
+
function foundation_widget_tag_cloud_args( $args ) {
|
790
|
+
$args['number'] = 20; // show less tags
|
791
|
+
$args['largest'] = 13; // make largest and smallest the same
|
792
|
+
$args['smallest'] = 13;
|
793
|
+
$args['unit'] = 'px';
|
794
|
+
$args['format'] = 'list'; // ul with a class of wp-tag-cloud
|
795
|
+
// $args['exclude'] = array(20, 80, 92); // exclude tags by ID
|
796
|
+
// $args['taxonomy'] = array('post_tag', 'ingredients'); // add post tags and ingredients taxonomy
|
797
|
+
|
798
|
+
return $args;
|
799
|
+
}
|
800
|
+
|
801
|
+
add_filter( 'widget_tag_cloud_args', 'foundation_widget_tag_cloud_args' );
|
802
|
+
|
803
|
+
/**
|
804
|
+
* Filter tag clould output so that it can be styled by CSS
|
805
|
+
*
|
806
|
+
* @since [foundation] 1.0
|
807
|
+
*/
|
808
|
+
function foundation_add_tag_class( $taglinks ) {
|
809
|
+
$tags = explode( '</a>', $taglinks );
|
810
|
+
$regex = "#(.*tag-link[-])(.*)(' title.*)#e";
|
811
|
+
foreach ( $tags as $tag ) {
|
812
|
+
$tagn[] = preg_replace( $regex, "('$1$2 label tag-'.get_tag($2)->slug.'$3')", $tag );
|
813
|
+
}
|
814
|
+
|
815
|
+
return implode( '</a>', $tagn );
|
816
|
+
}
|
817
|
+
|
818
|
+
add_filter( 'wp_tag_cloud', 'foundation_add_tag_class' );
|
819
|
+
|
820
|
+
/**
|
821
|
+
* Outputs WP Pagenavi pagination or wordpress navigation
|
822
|
+
*
|
823
|
+
* @since [foundation] 1.0
|
824
|
+
*/
|
825
|
+
function pagination( $query = false ) {
|
826
|
+
global $wp_query;
|
827
|
+
|
828
|
+
if ( is_single() ) {
|
829
|
+
?>
|
830
|
+
<nav id="comment-nav-below" class="navigation" role="navigation">
|
831
|
+
<h1 class="assistive-text section-heading"><?php _e( 'Post Navigation', 'foundation' ); ?></h1>
|
832
|
+
<?php
|
833
|
+
if ( $previous = get_previous_post() ):?>
|
834
|
+
<div class="nav-previous alignleft">
|
835
|
+
<a href="<?php echo get_permalink( $previous );?>" title="<?php printf( __( 'Permalink to %s', 'foundation' ), get_the_title( $previous ) );?>"><?php _e( 'Previous', 'foundation' ); ?></a>
|
836
|
+
</div>
|
837
|
+
<?php endif;?>
|
838
|
+
<?php
|
839
|
+
if ( $next = get_next_post() ):?>
|
840
|
+
<div class="nav-next alignright">
|
841
|
+
<a href="<?php echo get_permalink( $next );?>" title="<?php printf( __( 'Permalink to %s', 'foundation' ), get_the_title( $next ) );?>"><?php _e( 'Next', 'foundation' ); ?></a>
|
842
|
+
</div>
|
843
|
+
<?php endif;?>
|
844
|
+
</nav>
|
845
|
+
<?php
|
846
|
+
} else {
|
847
|
+
if ( $wp_query->max_num_pages > 1 ) {
|
848
|
+
if ( function_exists( 'wp_pagenavi' ) ) {
|
849
|
+
$args = array( 'options' => PageNavi_Core::$options->get_defaults() );
|
850
|
+
|
851
|
+
if ( $query ) {
|
852
|
+
$args[ 'query' ] = $query;
|
853
|
+
}
|
854
|
+
|
855
|
+
wp_pagenavi( $args );
|
856
|
+
} else {
|
857
|
+
//get_template_part( 'templates/pager' );
|
858
|
+
$big = 999999999; // This needs to be an unlikely integer
|
859
|
+
|
860
|
+
// For more options and info view the docs for paginate_links()
|
861
|
+
// http://codex.wordpress.org/Function_Reference/paginate_links
|
862
|
+
$paginate_links = paginate_links(
|
863
|
+
array(
|
864
|
+
'base' => str_replace( $big, '%#%', get_pagenum_link( $big ) ),
|
865
|
+
'current' => max( 1, get_query_var( 'paged' ) ),
|
866
|
+
'total' => $wp_query->max_num_pages,
|
867
|
+
'mid_size' => 5,
|
868
|
+
'prev_next' => True,
|
869
|
+
'prev_text' => __( '←' ),
|
870
|
+
'next_text' => __( '→' ),
|
871
|
+
'type' => 'array',
|
872
|
+
)
|
873
|
+
);
|
874
|
+
|
875
|
+
// Display the pagination if more than one page is found
|
876
|
+
if ( $paginate_links ) {
|
877
|
+
foreach ( $paginate_links as $link ) {
|
878
|
+
if ( strpos( $link, 'prev' ) !== false or strpos( 'next', $link ) !== false ) {
|
879
|
+
$links[] = '<li class="arrow">' . $link . '</li>';
|
880
|
+
}
|
881
|
+
elseif ( strpos( $link, 'current' ) !== false ) {
|
882
|
+
preg_match( '/<span[^>]+>(\d+)<\/span>/i', $link , $m );
|
883
|
+
|
884
|
+
$links[] = '<li class="current"><a href="">' . $m[1] . '</a></li>';
|
885
|
+
}
|
886
|
+
else {
|
887
|
+
$links[] = '<li>' . $link . '</li>';
|
888
|
+
}
|
889
|
+
}
|
890
|
+
|
891
|
+
|
892
|
+
echo '<ul class="pagination">';
|
893
|
+
echo implode( "\n", $links );
|
894
|
+
echo '</ul>';
|
895
|
+
}
|
896
|
+
}
|
897
|
+
}
|
898
|
+
}
|
899
|
+
}
|
900
|
+
|
901
|
+
add_action( 'pagination', 'pagination' );
|
902
|
+
|
903
|
+
/**
|
904
|
+
* Template for comments and pingbacks.
|
905
|
+
* Used as a callback by wp_list_comments() for displaying the comments.
|
906
|
+
*
|
907
|
+
* @since [foundation] 1.0
|
908
|
+
*/
|
909
|
+
function foundation_comment( $comment, $args, $depth ) {
|
910
|
+
$GLOBALS['comment'] = $comment;
|
911
|
+
switch ( $comment->comment_type ) {
|
912
|
+
case 'pingback' :
|
913
|
+
case 'trackback' :
|
914
|
+
// Display trackbacks differently than normal comments.
|
915
|
+
?>
|
916
|
+
<li <?php comment_class(); ?> id="comment-<?php comment_ID(); ?>">
|
917
|
+
<p><?php _e( 'Pingback:', 'foundation' ); ?> <?php comment_author_link(); ?> <?php edit_comment_link( __( '(Edit)', 'foundation' ), '<span class="edit-link">', '</span>' ); ?></p>
|
918
|
+
<?php
|
919
|
+
break;
|
920
|
+
default :
|
921
|
+
// Proceed with normal comments.
|
922
|
+
global $post;
|
923
|
+
?>
|
924
|
+
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID(); ?>">
|
925
|
+
<article id="comment-<?php comment_ID(); ?>" class="comment">
|
926
|
+
<header class="comment-meta comment-author vcard clearfix">
|
927
|
+
<?php
|
928
|
+
echo get_avatar( $comment, 44 );
|
929
|
+
printf(
|
930
|
+
'<cite class="fn">%1$s %2$s</cite>',
|
931
|
+
get_comment_author_link(),
|
932
|
+
// If current post author is also comment author, make it known visually.
|
933
|
+
( $comment->user_id === $post->post_author ) ? '<span> ' . __( 'Post author', 'foundation' ) . '</span>' : ''
|
934
|
+
);
|
935
|
+
printf(
|
936
|
+
'<a href="%1$s"><time datetime="%2$s">%3$s</time></a>',
|
937
|
+
esc_url( get_comment_link( $comment->comment_ID ) ),
|
938
|
+
get_comment_time( 'c' ),
|
939
|
+
/* translators: 1: date, 2: time */
|
940
|
+
sprintf( __( '%1$s at %2$s', 'foundation' ), get_comment_date(), get_comment_time() )
|
941
|
+
);
|
942
|
+
?>
|
943
|
+
</header>
|
944
|
+
|
945
|
+
<?php
|
946
|
+
if ( '0' == $comment->comment_approved ):
|
947
|
+
?>
|
948
|
+
<p class="comment-awaiting-moderation"><?php _e( 'Your comment is awaiting moderation.', 'foundation' ); ?></p>
|
949
|
+
<?php endif; ?>
|
950
|
+
|
951
|
+
<section class="comment-content comment clearfix">
|
952
|
+
<?php comment_text(); ?>
|
953
|
+
</section>
|
954
|
+
|
955
|
+
<div class="reply">
|
956
|
+
<?php edit_comment_link( __( 'Edit', 'foundation' ), '<span class="edit-link">', '</span> / ' ); ?>
|
957
|
+
<?php comment_reply_link( array_merge( $args, array( 'reply_text' => __( 'Reply', 'foundation' ), 'after' => ' <span>↓</span>', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
|
958
|
+
</div>
|
959
|
+
</article>
|
960
|
+
<?php
|
961
|
+
break;
|
962
|
+
} // end comment_type check
|
963
|
+
}
|
964
|
+
|
965
|
+
/**
|
966
|
+
* Redirect to post when search query returns single result
|
967
|
+
*
|
968
|
+
* @see http://wpsnipp.com/index.php/functions-php/redirect-to-post-when-search-query-returns-single-result/
|
969
|
+
* @since [foundation] 1.0
|
970
|
+
*/
|
971
|
+
function foundation_single_result() {
|
972
|
+
if ( is_search() ) {
|
973
|
+
global $wp_query;
|
974
|
+
if ( $wp_query->post_count == 1 ) {
|
975
|
+
wp_redirect( get_permalink( $wp_query->posts['0']->ID ) );
|
976
|
+
}
|
977
|
+
}
|
978
|
+
}
|
979
|
+
add_action( 'template_redirect', 'foundation_single_result' );
|
980
|
+
|
981
|
+
/**
|
982
|
+
* Add postMessage support for site title and description for the Theme Customizer.
|
983
|
+
*
|
984
|
+
* @since [foundation] 1.0
|
985
|
+
*
|
986
|
+
* @param WP_Customize_Manager $wp_customize Theme Customizer object.
|
987
|
+
* @return void
|
988
|
+
*/
|
989
|
+
function foundation_customize_register( $wp_customize ) {
|
990
|
+
$wp_customize->get_setting( 'blogname' )->transport = 'postMessage';
|
991
|
+
$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';
|
992
|
+
}
|
993
|
+
add_action( 'customize_register', 'foundation_customize_register' );
|
994
|
+
|
995
|
+
/* SHORTCODES */
|
996
|
+
|
997
|
+
// Allow shortcodes in widgets
|
998
|
+
add_filter( 'widget_text', 'do_shortcode' );
|
999
|
+
|
1000
|
+
/**
|
1001
|
+
* The supported attributes for the shortcode are 'id', 'align', 'width', and 'caption'.
|
1002
|
+
*
|
1003
|
+
* @since [foundation] 1.0
|
1004
|
+
*/
|
1005
|
+
function foundation_shortcode_caption( $atts, $content = null ) {
|
1006
|
+
extract(
|
1007
|
+
shortcode_atts(
|
1008
|
+
array(
|
1009
|
+
'id' => '',
|
1010
|
+
'align' => 'alignnone',
|
1011
|
+
'width' => '',
|
1012
|
+
'caption' => '',
|
1013
|
+
), $atts
|
1014
|
+
)
|
1015
|
+
);
|
1016
|
+
|
1017
|
+
if ( 1 > ( int ) $width )
|
1018
|
+
return $content;
|
1019
|
+
|
1020
|
+
if ( empty( $caption ) ) {
|
1021
|
+
preg_match( '/(<img[^>]+>)[ ]?(.*)/i', $content, $match );
|
1022
|
+
$content = $match[1];
|
1023
|
+
$caption = $match[2];
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
$id = $id ? $id : 'attachment_' . rand( 1, 999 );
|
1027
|
+
$idtag = 'id="' . esc_attr( $id ) . '"';
|
1028
|
+
|
1029
|
+
$out[] = '<figure ' . $idtag . 'aria-describedby="figcaption_' . $id . '" class="post-image wp-caption ' . $align . '">';
|
1030
|
+
$out[] = apply_filters( 'foundation_shortcode_caption_content', do_shortcode( $content ), $id, '', '' );
|
1031
|
+
$out[] = '<figcaption id="figcaption_' . $id . '" class="caption wp-caption-text">' . wpautop( wptexturize( $caption ) ) . '</figcaption>';
|
1032
|
+
$out[] = '</figure>';
|
1033
|
+
|
1034
|
+
return implode( "\n", $out );
|
1035
|
+
}
|
1036
|
+
|
1037
|
+
add_shortcode( 'wp_caption', 'foundation_shortcode_caption' );
|
1038
|
+
add_shortcode( 'caption', 'foundation_shortcode_caption' );
|
1039
|
+
|
1040
|
+
/**
|
1041
|
+
* Gallery shortcode.
|
1042
|
+
*
|
1043
|
+
* @since [foundation] 1.0
|
1044
|
+
*/
|
1045
|
+
function foundation_gallery_shortcode( $attr ) {
|
1046
|
+
global $post, $wp_locale;
|
1047
|
+
|
1048
|
+
$output = array();
|
1049
|
+
|
1050
|
+
$args = array( 'post_type' => 'attachment', 'numberposts' => - 1, 'post_status' => null, 'post_parent' => $post->ID );
|
1051
|
+
$attachments = get_posts( $args );
|
1052
|
+
if ( $attachments ) {
|
1053
|
+
$i = 0;
|
1054
|
+
$output[] = '<ul class="block-grid three-up">';
|
1055
|
+
foreach ( $attachments as $attachment ) {
|
1056
|
+
$src = wp_get_attachment_image_src( $attachment->ID , 'full' );
|
1057
|
+
$active = ( $i == 0) ? ' active' : '';
|
1058
|
+
$caption = wpautop( wptexturize( esc_attr( trim( strip_tags( $attachment->post_excerpt ) ) ) ) );
|
1059
|
+
$data_caption = $caption ? ' data-caption="' . $caption . '"' : '';
|
1060
|
+
$output[] = '<li class="item' . $active . '">';
|
1061
|
+
$output[] = '<a href="' . get_attachment_link( $attachment->ID ) . '">';
|
1062
|
+
$output[] = '<img' . $data_caption . ' src="' . $src[0] . '" alt="' . esc_attr( trim( strip_tags( $attachment->post_title ) ) ) . '">';
|
1063
|
+
$output[] = '</a>';
|
1064
|
+
$output[] = '</li>';
|
1065
|
+
++$i;
|
1066
|
+
}
|
1067
|
+
$output[] = '</ul>';
|
1068
|
+
}
|
1069
|
+
|
1070
|
+
return implode( "\n", $output );
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
// removes standard shortcode
|
1074
|
+
remove_shortcode( 'gallery', 'gallery_shortcode' );
|
1075
|
+
add_shortcode( 'gallery', 'foundation_gallery_shortcode' );
|
1076
|
+
|
1077
|
+
|
1078
|
+
/* ADMIN STUFF */
|
1079
|
+
|
1080
|
+
/**
|
1081
|
+
* Remove unnecessary dashboard widgets
|
1082
|
+
*
|
1083
|
+
* @link http://www.deluxeblogtips.com/2011/01/remove-dashboard-widgets-in-wordpress.html
|
1084
|
+
* @since [foundation] 1.0
|
1085
|
+
*/
|
1086
|
+
function foundation_remove_dashboard_widgets() {
|
1087
|
+
// Incoming Links Widget
|
1088
|
+
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
|
1089
|
+
|
1090
|
+
// Plugins Widget
|
1091
|
+
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' );
|
1092
|
+
|
1093
|
+
remove_meta_box( 'dashboard_primary', 'dashboard', 'normal' );
|
1094
|
+
remove_meta_box( 'dashboard_secondary', 'dashboard', 'normal' );
|
1095
|
+
|
1096
|
+
// Sitepress WPML Plugin Widget
|
1097
|
+
remove_meta_box( 'icl_dashboard_widget', 'dashboard', 'normal' );
|
1098
|
+
|
1099
|
+
// Yoast's SEO Plugin Widget
|
1100
|
+
remove_meta_box( 'yoast_db_widget', 'dashboard', 'normal' );
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
add_action( 'admin_init', 'foundation_remove_dashboard_widgets' );
|
1104
|
+
|
1105
|
+
/**
|
1106
|
+
* Adds custom menu to admin bar
|
1107
|
+
*
|
1108
|
+
* @since [foundation] 1.0
|
1109
|
+
*/
|
1110
|
+
function foundation_bar_menu( $wp_admin_bar ) {
|
1111
|
+
if ( ! is_super_admin() or ! is_admin_bar_showing() )
|
1112
|
+
return;
|
1113
|
+
|
1114
|
+
/**
|
1115
|
+
* Change "Howdy"
|
1116
|
+
*/
|
1117
|
+
// get the node that contains "howdy"
|
1118
|
+
$my_account = $wp_admin_bar->get_node( 'my-account' );
|
1119
|
+
// change the "howdy"
|
1120
|
+
$my_account->title = str_replace( 'Howdy,', __( 'Hi,', 'foundation' ), $my_account->title );
|
1121
|
+
// remove the original node
|
1122
|
+
$wp_admin_bar->remove_node( 'my-account' );
|
1123
|
+
// add back our modified version
|
1124
|
+
$wp_admin_bar->add_node( $my_account );
|
1125
|
+
|
1126
|
+
/**
|
1127
|
+
* Removing the "W" menu
|
1128
|
+
* I have nothing against it, but I *never* use it
|
1129
|
+
*/
|
1130
|
+
$wp_admin_bar->remove_menu( 'wp-logo' );
|
1131
|
+
|
1132
|
+
/**
|
1133
|
+
* Create a "Favorites" menu
|
1134
|
+
* First, just create the parent menu item
|
1135
|
+
*/
|
1136
|
+
$wp_admin_bar->add_menu(
|
1137
|
+
array(
|
1138
|
+
'id' => 'favorites',
|
1139
|
+
'parent' => 'top-secondary', // puts it on the right-hand side
|
1140
|
+
'title' => __( 'Favorites', 'foundation' ),
|
1141
|
+
)
|
1142
|
+
);
|
1143
|
+
|
1144
|
+
/**
|
1145
|
+
* Then add links to it
|
1146
|
+
* This link goes to the All Settings page,
|
1147
|
+
* so only show it to users that have appropriate privileges
|
1148
|
+
*/
|
1149
|
+
if ( current_user_can( 'manage_options' ) ) {
|
1150
|
+
$wp_admin_bar->add_menu(
|
1151
|
+
array(
|
1152
|
+
'id' => 'all-settings',
|
1153
|
+
'parent' => 'favorites',
|
1154
|
+
'title' => __( 'Options', 'foundation' ),
|
1155
|
+
'href' => admin_url( 'options.php' ),
|
1156
|
+
)
|
1157
|
+
);
|
1158
|
+
}
|
1159
|
+
|
1160
|
+
// This one goes to the list of the current user's posts
|
1161
|
+
$wp_admin_bar->add_menu(
|
1162
|
+
array(
|
1163
|
+
'id' => 'my-posts',
|
1164
|
+
'parent' => 'favorites',
|
1165
|
+
'title' => __( 'My Posts', 'foundation' ),
|
1166
|
+
'href' => admin_url( 'edit.php?post_type=post&author=' . get_current_user_id() ),
|
1167
|
+
)
|
1168
|
+
);
|
1169
|
+
|
1170
|
+
// MySQL query and script execution timer output
|
1171
|
+
$wp_admin_bar->add_menu(
|
1172
|
+
array(
|
1173
|
+
'id' => 'do_query_bar',
|
1174
|
+
'parent' => 'top-secondary', // puts it on the right-hand side
|
1175
|
+
'title' => get_num_queries() . 'Q - ' . timer_stop() . 's', // link title
|
1176
|
+
'href' => '#',
|
1177
|
+
'meta' => false,
|
1178
|
+
)
|
1179
|
+
);
|
1180
|
+
}
|
1181
|
+
|
1182
|
+
add_action( 'admin_bar_menu', 'foundation_bar_menu', '1000' );
|
1183
|
+
|
1184
|
+
/**
|
1185
|
+
* This simple hack will remove the AIM, Yahoo and Jabber fields and will replace them with a bunch of other social network profiles.
|
1186
|
+
*
|
1187
|
+
* @since [foundation] 1.0
|
1188
|
+
*/
|
1189
|
+
function foundation_user_contactmethods( $contactmethods ) {
|
1190
|
+
unset( $contactmethods['aim'], $contactmethods['yim'], $contactmethods['jabber'] );
|
1191
|
+
|
1192
|
+
// Add Location
|
1193
|
+
$contactmethods['user_location'] = __( 'Location', 'foundation' );
|
1194
|
+
|
1195
|
+
// Add Facebook
|
1196
|
+
$contactmethods['user_fb'] = __( 'Facebook', 'foundation' );
|
1197
|
+
|
1198
|
+
// Add Pinterest
|
1199
|
+
$contactmethods['user_pt'] = __( 'Pinterest', 'foundation' );
|
1200
|
+
|
1201
|
+
// Add Twitter
|
1202
|
+
$contactmethods['user_tw'] = __( 'Twitter', 'foundation' );
|
1203
|
+
|
1204
|
+
// Add Linkedin
|
1205
|
+
$contactmethods['user_lk'] = __( 'Linkedin', 'foundation' );
|
1206
|
+
|
1207
|
+
// Add Github
|
1208
|
+
$contactmethods['user_gh'] = __( 'Github', 'foundation' );
|
1209
|
+
|
1210
|
+
// Add Google+
|
1211
|
+
$contactmethods['google_profile'] = __( 'Google+ profile', 'foundation' );
|
1212
|
+
|
1213
|
+
return $contactmethods;
|
1214
|
+
}
|
1215
|
+
|
1216
|
+
add_filter( 'user_contactmethods', 'foundation_user_contactmethods' );
|
1217
|
+
|
1218
|
+
/**
|
1219
|
+
* Allow more HTML tags in the editor
|
1220
|
+
* Add more languages to spell check
|
1221
|
+
*
|
1222
|
+
* @since [foundation] 1.0
|
1223
|
+
*/
|
1224
|
+
function foundation_change_mce_options( $array ) {
|
1225
|
+
$ext = 'pre[id|name|class|style],iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]';
|
1226
|
+
|
1227
|
+
if ( isset( $array['extended_valid_elements'] ) ) {
|
1228
|
+
$array['extended_valid_elements'] .= ','.$ext;
|
1229
|
+
}
|
1230
|
+
else {
|
1231
|
+
$array['extended_valid_elements'] = $ext;
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
// Add block format elements you want to show in dropdown
|
1235
|
+
$array['theme_advanced_blockformats'] = 'h1,h2,h3,h4,p,code,blockquote';
|
1236
|
+
$array['theme_advanced_disable'] = 'strikethrough,underline,forecolor,justifyfull';
|
1237
|
+
$array[ 'spellchecker_languages' ] = '+Spanish=sp, English=en';
|
1238
|
+
|
1239
|
+
return $array;
|
1240
|
+
}
|
1241
|
+
|
1242
|
+
add_filter( 'tiny_mce_before_init', 'foundation_change_mce_options' );
|
1243
|
+
|
1244
|
+
/**
|
1245
|
+
* Define custom styles for the dropdown menu
|
1246
|
+
*
|
1247
|
+
* @since [foundation] 1.0
|
1248
|
+
*/
|
1249
|
+
function foundation_style_formats( $settings ) {
|
1250
|
+
$style_formats = array(
|
1251
|
+
array(
|
1252
|
+
'title' => __( 'Button', 'foundation' ),
|
1253
|
+
'selector' => 'a',
|
1254
|
+
'classes' => 'button',
|
1255
|
+
'exact' => true,
|
1256
|
+
),
|
1257
|
+
array(
|
1258
|
+
'title' => __( 'Lead', 'foundation' ),
|
1259
|
+
'selector' => 'p',
|
1260
|
+
'classes' => 'lead',
|
1261
|
+
),
|
1262
|
+
array(
|
1263
|
+
'title' => __( 'Label', 'foundation' ),
|
1264
|
+
'inline' => 'span',
|
1265
|
+
'classes' => 'label',
|
1266
|
+
),
|
1267
|
+
array(
|
1268
|
+
'title' => __( 'Panel', 'foundation' ),
|
1269
|
+
'block' => 'div',
|
1270
|
+
'classes' => 'panel',
|
1271
|
+
'wrapper' => true,
|
1272
|
+
),
|
1273
|
+
array(
|
1274
|
+
'title' => __( 'Panel callout', 'foundation' ),
|
1275
|
+
'block' => 'div',
|
1276
|
+
'classes' => 'panel callout',
|
1277
|
+
'wrapper' => true,
|
1278
|
+
),
|
1279
|
+
array(
|
1280
|
+
'title' => __( 'Radius (Panel, Label, Button)', 'foundation' ),
|
1281
|
+
'selector' => 'a.button, span.label, div.panel, div.panel.callout',
|
1282
|
+
'classes' => 'radius',
|
1283
|
+
),
|
1284
|
+
array(
|
1285
|
+
'title' => __( 'Round (Label, Button)', 'foundation' ),
|
1286
|
+
'selector' => 'a.button, span.label',
|
1287
|
+
'classes' => 'round',
|
1288
|
+
),
|
1289
|
+
array(
|
1290
|
+
'title' => __( 'Alert (Label, Button)', 'foundation' ),
|
1291
|
+
'selector' => 'a.button, span.label',
|
1292
|
+
'classes' => 'alert',
|
1293
|
+
),
|
1294
|
+
array(
|
1295
|
+
'title' => __( 'Message (Label, Button)', 'foundation' ),
|
1296
|
+
'selector' => 'a.button, span.label',
|
1297
|
+
'classes' => 'success',
|
1298
|
+
),
|
1299
|
+
array(
|
1300
|
+
'title' => __( 'Secondary (Label, Button)', 'foundation' ),
|
1301
|
+
'selector' => 'a.button, span.label',
|
1302
|
+
'classes' => 'secondary',
|
1303
|
+
),
|
1304
|
+
array(
|
1305
|
+
'title' => __( 'Subheader (Header)', 'foundation' ),
|
1306
|
+
'selector' => 'h1, h2, h3, h4, h5, h6',
|
1307
|
+
'classes' => 'subheader',
|
1308
|
+
),
|
1309
|
+
array(
|
1310
|
+
'title' => __( 'Keyborad', 'foundation' ),
|
1311
|
+
'inline' => 'kbd',
|
1312
|
+
),
|
1313
|
+
);
|
1314
|
+
|
1315
|
+
$settings['style_formats'] = json_encode( apply_filters( 'foundation_style_formats', $style_formats ) );
|
1316
|
+
|
1317
|
+
return $settings;
|
1318
|
+
}
|
1319
|
+
|
1320
|
+
add_filter( 'tiny_mce_before_init', 'foundation_style_formats' );
|
1321
|
+
|
1322
|
+
/**
|
1323
|
+
* Add the Styles dropdown to the visual editor
|
1324
|
+
*
|
1325
|
+
* @since [foundation] 1.0
|
1326
|
+
*/
|
1327
|
+
function foundation_add_mce_button( $buttons ) {
|
1328
|
+
if ( ! in_array( 'styleselect', $buttons ) ) {
|
1329
|
+
$buttons[] = 'styleselect';
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
return $buttons;
|
1333
|
+
}
|
1334
|
+
|
1335
|
+
add_filter( 'mce_buttons_2', 'foundation_add_mce_button' );
|
1336
|
+
|
1337
|
+
/**
|
1338
|
+
* Adds previous/next links to post edition window
|
1339
|
+
*
|
1340
|
+
* @since [foundation] 1.0
|
1341
|
+
*/
|
1342
|
+
function foundation_add_navigation_edit_posts() {
|
1343
|
+
if ( isset( $_GET['post'] ) and isset( $_GET['action'] ) and $_GET['action'] == 'edit' ) {
|
1344
|
+
global $post;
|
1345
|
+
|
1346
|
+
$args = array(
|
1347
|
+
'public' => true,
|
1348
|
+
'_builtin' => false,
|
1349
|
+
);
|
1350
|
+
$output = 'names'; // names or objects, note names is the default
|
1351
|
+
$operator = 'and'; // 'and' or 'or'
|
1352
|
+
|
1353
|
+
$post_types = get_post_types( $args, $output, $operator );
|
1354
|
+
|
1355
|
+
$post_types['post'] = 'post';
|
1356
|
+
$post_types['page'] = 'page';
|
1357
|
+
|
1358
|
+
if ( is_object( $post ) and in_array( $post->post_type, $post_types ) ) {
|
1359
|
+
$wtf = array( true, false );
|
1360
|
+
foreach ( $wtf as $prev ) {
|
1361
|
+
$p = get_adjacent_post( false, '', $prev );
|
1362
|
+
|
1363
|
+
if ( ! empty( $p ) ) {
|
1364
|
+
echo '<script>
|
1365
|
+
jQuery(function($) {
|
1366
|
+
$(".wrap h2" )
|
1367
|
+
.append(\'<a class="add-new-h2" href="' . admin_url( 'post.php?action=edit&post=' . $p->ID ) . '" title="' . __( 'Editar', 'foundation' ) . ' ' . apply_filters( 'the_title', $p->post_title ) . '">' . ( $prev ? '« ' : '' ) . apply_filters( 'the_title', $p->post_title ) . ( ! $prev ? ' »' : '' ) . '</a>\' );
|
1368
|
+
});
|
1369
|
+
</script>';
|
1370
|
+
}
|
1371
|
+
}
|
1372
|
+
}
|
1373
|
+
}
|
1374
|
+
}
|
1375
|
+
|
1376
|
+
add_action( 'admin_head', 'foundation_add_navigation_edit_posts' );
|
1377
|
+
|
1378
|
+
/**
|
1379
|
+
* Custom Login Logo Support
|
1380
|
+
*
|
1381
|
+
* @since [foundation] 1.0
|
1382
|
+
*/
|
1383
|
+
function foundation_custom_login_logo() {
|
1384
|
+
echo '<style type="text/css">
|
1385
|
+
h1 a { background-image:url(' . get_template_directory_uri() . '/images/login-logo.png) !important; }
|
1386
|
+
</style>';
|
1387
|
+
}
|
1388
|
+
|
1389
|
+
add_action( 'login_head', 'foundation_custom_login_logo' );
|
1390
|
+
|
1391
|
+
/**
|
1392
|
+
* Custom Login URL
|
1393
|
+
*
|
1394
|
+
* @since [foundation] 1.0
|
1395
|
+
*/
|
1396
|
+
function foundation_wp_login_url() {
|
1397
|
+
return home_url();
|
1398
|
+
}
|
1399
|
+
|
1400
|
+
add_filter( 'login_headerurl', 'foundation_wp_login_url' );
|
1401
|
+
|
1402
|
+
/**
|
1403
|
+
* Custom Login Title
|
1404
|
+
*
|
1405
|
+
* @since [foundation] 1.0
|
1406
|
+
*/
|
1407
|
+
function foundation_wp_login_title() {
|
1408
|
+
return get_option( 'blogname' );
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
add_filter( 'login_headertitle', 'foundation_wp_login_title' );
|
1412
|
+
|
1413
|
+
/**
|
1414
|
+
* Custom Backend Footer
|
1415
|
+
*
|
1416
|
+
* @since [foundation] 1.0
|
1417
|
+
*/
|
1418
|
+
function foundation_custom_admin_footer() {
|
1419
|
+
$credits = '<span id="footer-thankyou">Crafted by <a href="//alexsancho.name" target="_blank">Alex Sancho</a></span>.';
|
1420
|
+
|
1421
|
+
echo apply_filters( 'foundation_custom_admin_footer', $credits );
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
// adding it to the admin area
|
1425
|
+
add_filter( 'admin_footer_text', 'foundation_custom_admin_footer' );
|