├── LICENSE-MIT.md ├── README.md ├── css └── wp-native.css ├── dashboard ├── change-footer-admin.php ├── change-login-label-username.php ├── change-post-label.php ├── disable-drag-metabox-dashboard.php ├── hide-item-menu-dashboard.php ├── insert-custom-dashboard-widgets.php ├── insert-custom-toolbar-link.php ├── insert-custom-toolbar-menu-submenu.php ├── insert-user-id-column.php ├── remove-dashboard-widgets.php ├── remove-post-meta-boxes.php ├── remove-some-menu-items.php ├── restrict-admin-access.php ├── send-mail-post-pending.php ├── show-admin-message.php └── unregister-default-widgets.php ├── errors └── turn-off-all-error-reporting.php ├── htaccess └── .htaccess ├── navigation ├── get-description-menu.php ├── insert-breadcrumbs.php └── insert-dimox-breadcrumbs.php ├── page ├── insert-tag-pages.php └── navigation-between-pages.php ├── post ├── after-all-post-content.php ├── category-count.php ├── change-post-label.php ├── count-publish-posts.php ├── count-view-posts.php ├── custom-excerpt-length.php ├── custom-post-title-length.php ├── custom-post-type.php ├── custom-result-search.php ├── disable-comments-fields.php ├── display-last-modified-date.php ├── embedded-youtube-responsive.js ├── insert-disqus.php ├── insert-more-buttons-editor.php ├── pagination.php ├── rename-post-formats.php ├── shortcode.php └── view-popular-posts.php ├── robots └── robots.md ├── theme-suport ├── activate-maintenace-mode.php ├── adjust-image-sizes-attr.php ├── change-default-error-messages.php ├── deregister-jquery.php ├── disable-srcset.php ├── get-theme-information.php ├── hide-usernames-from-comment-class.php ├── insert-random-error-messages.php ├── register-sidebar.php ├── remove-default-image-thumbnails.php ├── remove-image-size-attributes.php ├── remove-junk-header.php ├── remove-max-srcset-image-width.php ├── remove-recent-comment-style.php ├── remove-theme-suport.php ├── remove-ver-css-js.php ├── stop-loading-acf-js-css-all-pages.php └── user-check-disables-features.php ├── tips ├── splash │ ├── functions.php │ ├── site-under-construction.png │ └── splash.php └── tips.md └── wp-config └── wp-config.md /LICENSE-MIT.md: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Anderson Nascimento 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WP Snippets 2 | 3 | > Code Snippet Library for WordPress 4 | 5 | ##### CSS 6 | - [wp native](https://github.com/theandersonn/wp-snippets/blob/master/css/wp-native.css) 7 | 8 | ##### Dashboard 9 | - [change footer admin](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/change-footer-admin.php) 10 | - [change login label username](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/change-login-label-username.php) 11 | - [change post label](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/change-post-label.php) 12 | - [disable drag metabox dashboard](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/disable-drag-metabox-dashboard.php) 13 | - [hide item menu dashboard](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/hide-item-menu-dashboard.php) 14 | - [insert custom dashboard widgets](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/insert-custom-dashboard-widgets.php) 15 | - [insert custom toolbar link](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/insert-custom-toolbar-link.php) 16 | - [insert custom toolbar menu submenu](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/insert-custom-toolbar-menu-submenu.php) 17 | - [insert user id column](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/insert-user-id-column.php) 18 | - [remove dashboard widgets](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/remove-dashboard-widgets.php) 19 | - [remove post meta boxes](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/remove-post-meta-boxes.php) 20 | - [remove some menu items](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/remove-some-menu-items.php) 21 | - [restrict admin access](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/restrict-admin-access.php) 22 | - [send mail post pending](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/send-mail-post-pending.php) 23 | - [show admin message](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/show-admin-message.php) 24 | - [unregister default widgets](https://github.com/theandersonn/wp-snippets/blob/master/dashboard/unregister-default-widgets.php) 25 | 26 | ##### Errors 27 | - [Turn off all error reporting](https://github.com/theandersonn/wp-snippets/blob/master/errors/turn-off-all-error-reporting.php) 28 | 29 | ##### Navigation 30 | - [get description menu](https://github.com/theandersonn/wp-snippets/blob/master/navigation/get-description-menu.php) 31 | - [insert breadcrumbs](https://github.com/theandersonn/wp-snippets/blob/master/navigation/insert-breadcrumbs.php) 32 | - [insert breadcrumbs dimox](https://github.com/theandersonn/wp-snippets/blob/master/navigation/insert-dimox-breadcrumbs.php) 33 | 34 | 35 | ##### Page 36 | - [insert tag pages](https://github.com/theandersonn/wp-snippets/blob/master/page/insert-tag-pages.php) 37 | - [navigation between pages](https://github.com/theandersonn/wp-snippets/blob/master/page/navigation-between-pages.php) 38 | 39 | ##### Post 40 | - [after all post content](https://github.com/theandersonn/wp-snippets/blob/master/post/after-all-post-content.php) 41 | - [category count](https://github.com/theandersonn/wp-snippets/blob/master/post/category-count.php) 42 | - [change post label](https://github.com/theandersonn/wp-snippets/blob/master/post/change-post-label.php) 43 | - [count publish posts](https://github.com/theandersonn/wp-snippets/blob/master/post/count-publish-posts.php) 44 | - [count view posts](https://github.com/theandersonn/wp-snippets/blob/master/post/count-view-posts.php) 45 | - [custom excerpt length](https://github.com/theandersonn/wp-snippets/blob/master/post/custom-excerpt-length.php) 46 | - [custom post type](https://github.com/theandersonn/wp-snippets/blob/master/post/custom-post-type.php) 47 | - [custom post title length](https://github.com/theandersonn/wp-snippets/blob/master/post/custom-post-title-length.php) 48 | - [custom result search](https://github.com/theandersonn/wp-snippets/blob/master/post/custom-result-search.php) 49 | - [display last modified date](https://github.com/theandersonn/wp-snippets/blob/master/post/display-last-modified-date.php) 50 | - [disable comments fields](https://github.com/theandersonn/wp-snippets/blob/master/post/disable-comments-fields.php) 51 | - [embedded youtube responsive](https://github.com/theandersonn/wp-snippets/blob/master/post/embedded-youtube-responsive.js) 52 | - [insert disqus](https://github.com/theandersonn/wp-snippets/blob/master/post/insert-insert-disqus.php) 53 | - [insert more buttons editor](https://github.com/theandersonn/wp-snippets/blob/master/post/insert-more-buttons-editor.php) 54 | - [pagination](https://github.com/theandersonn/wp-snippets/blob/master/post/insert-pagination.php) 55 | - [rename post formats](https://github.com/theandersonn/wp-snippets/blob/master/post/rename-post-formats.php) 56 | - [view popular posts](https://github.com/theandersonn/wp-snippets/blob/master/post/view-popular-posts.php) 57 | - [shortcode](https://github.com/theandersonn/wp-snippets/blob/master/post/shortcode.php) 58 | 59 | ##### Robots.txt 60 | - [robots.txt](https://github.com/theandersonn/wp-snippets/blob/master/robots/robots.md) 61 | 62 | ##### Theme Suport 63 | - [activate maintenace mode](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/activate-maintenace-mode.php) 64 | - [adjust image sizes attr](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/adjust-image-sizes-attr.php) 65 | - [change default error messages](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/change-default-error-messages.php) 66 | - [deregister jquery](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/deregister-jquery.php) 67 | - [disable srcset](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/disable-srcset.php) 68 | - [get theme information](https://github.com/theandersonn/wp-snippets/blob/master/get-theme-information.php) 69 | - [hide usernames from comment class](https://github.com/theandersonn/wp-snippets/blob/master/hide-usernames-from-comment-class.php) 70 | - [random error messages](https://github.com/theandersonn/wp-snippets/blob/master/random-error-messages.php) 71 | - [register sidebar](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/register-sidebar.php) 72 | - [remove default image thumbnails](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-default-image-thumbnails.php) 73 | - [remove image size attributes](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-image-size-attributes.php) 74 | - [remove junk header](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-junk-header.php) 75 | - [remove max srcset image width](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-max-srcset-image-width.php) 76 | - [remove recent comment style](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-recent-comment-style.php) 77 | - [remove theme suport](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-theme-suport.php) 78 | - [remove ver css js](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/remove-ver-css-js.php) 79 | - [user check disables features](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/user-check-disables-features.php) 80 | - [stop loading acf js and css all pages](https://github.com/theandersonn/wp-snippets/blob/master/theme-suport/stop-loading-acf-js-css-all-pages.php) 81 | 82 | ##### Tips 83 | - [maintenace mode with splash](https://github.com/theandersonn/wp-snippets/blob/master/tips/splash/) 84 | 85 | ##### WP-config 86 | - [wp config](https://github.com/theandersonn/wp-snippets/tree/master/wp-config) 87 | 88 | ##### .htaccess 89 | - [.htaccess](https://github.com/theandersonn/wp-snippets/blob/master/htaccess/.htaccess) 90 | 91 | ## Contributing 92 | 93 | 1. Fork it! 94 | 2. Create your feature branch: `git checkout -b my-new-feature` 95 | 3. Commit your changes: `git commit -m 'Add some feature'` 96 | 4. Push to the branch: `git push origin my-new-feature` 97 | 5. Submit a pull request :D 98 | 99 | ## Questions and Suggestions 100 | If you have any questions or suggestions , open an [issue](https://github.com/theandersonn/wp-snippets/issues/new) and send your feedback. 101 | 102 | ## License 103 | 104 | [MIT](https://github.com/theandersonn/wp-snippets/blob/master/LICENSE-MIT.md) © [Anderson Nascimento](https://github.com/theandersonn) 105 | -------------------------------------------------------------------------------- /css/wp-native.css: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------- 2 | BODY 3 | ---------------------------------------------- */ 4 | .rtl {} 5 | .home {} 6 | .blog {} 7 | .archive {} 8 | .date {} 9 | .search {} 10 | .paged {} 11 | .attachment {} 12 | .error404 {} 13 | .single postid-(id) {} 14 | .attachmentid-(id) {} 15 | .attachment-(mime-type) {} 16 | .author {} 17 | .author-(user_nicename) {} 18 | .category {} 19 | .category-(slug) {} 20 | .tag {} 21 | .tag-(slug) {} 22 | .page-parent {} 23 | .page-child parent-pageid-(id) {} 24 | .page-template page-template-(template file name) {} 25 | .search-results {} 26 | .search-no-results {} 27 | .logged-in {} 28 | .paged-(page number) {} 29 | .single-paged-(page number) {} 30 | .page-paged-(page number) {} 31 | .category-paged-(page number) {} 32 | .tag-paged-(page number) {} 33 | .date-paged-(page number) {} 34 | .author-paged-(page number) {} 35 | .search-paged-(page number) {} 36 | 37 | /* ---------------------------------------------- 38 | POSTS 39 | ---------------------------------------------- */ 40 | .post-id {} 41 | .post {} 42 | .page {} 43 | .attachment {} 44 | .sticky {} 45 | .hentry {} 46 | .category-misc {} 47 | .category-example {} 48 | .tag-news {} 49 | .tag-wordpress {} 50 | .tag-markup {} 51 | 52 | /* ---------------------------------------------- 53 | GERADAS PELA FUNÇÃO post_class () 54 | ---------------------------------------------- */ 55 | .format-image {} 56 | .format-gallery {} 57 | .format-chat {} 58 | .format-link {} 59 | .format-quote {} 60 | .format-status {} 61 | .format-video {} 62 | 63 | /* ---------------------------------------------- 64 | MENU 65 | ---------------------------------------------- */ 66 | .main-menu{} 67 | .main-menu ul {} 68 | .main-menu ul ul {} 69 | .main-menu li {} 70 | .main-menu li a {} 71 | .main-menu li ul {} 72 | .main-menu li li {} 73 | .main-menu li li a {}.current_page_item{} 74 | .current-cat{} 75 | .current-menu-item{} 76 | .menu-item-type-taxonomy{} 77 | .menu-item-type-post_type{} 78 | .menu-item-type-custom{} 79 | .menu-item-home{} 80 | 81 | /* ---------------------------------------------- 82 | EDITOR 83 | ---------------------------------------------- */ 84 | .entry-content img {} 85 | .alignleft, img.alignleft {} 86 | .alignright, img.alignright {} 87 | .aligncenter, img.aligncenter {} 88 | .alignnone, img.alignnone {} 89 | .wp-caption {} 90 | .wp-caption img {} 91 | .wp-caption p.wp-caption-text {} 92 | .wp-smiley {}blockquote.left {} 93 | blockquote.right {} 94 | .gallery dl {} 95 | .gallery dt {} 96 | .gallery dd {} 97 | .gallery dl a {} 98 | .gallery dl img {} 99 | .gallery-caption {} 100 | .size-full {} 101 | .size-large {} 102 | .size-medium {} 103 | .size-thumbnail {} 104 | 105 | /* ---------------------------------------------- 106 | WIDGETS 107 | ---------------------------------------------- */ 108 | .widget {} 109 | #searchform {} 110 | .widget_search {} 111 | .screen-reader-text {} 112 | .widget_meta {} 113 | .widget_meta ul {} 114 | .widget_meta ul li {} 115 | .widget_meta ul li a {} 116 | .widget_links {} 117 | .widget_links ul {} 118 | .widget_links ul li {} 119 | .widget_links ul li a {} 120 | .widget_archive {} 121 | .widget_archive ul {} 122 | .widget_archive ul li {} 123 | .widget_archive ul li a {} 124 | .widget_archive select {} 125 | .widget_archive option {} 126 | .widget_pages {} 127 | .widget_pages ul {} 128 | .widget_pages ul li {} 129 | .widget_pages ul li a {} 130 | .widget_links {} 131 | .widget_links li:after {} 132 | .widget_links li:before {} 133 | .widget_tag_cloud {} 134 | .widget_tag_cloud a {} 135 | .widget_tag_cloud a:after {} 136 | .widget_tag_cloud a:before {} 137 | .widget_calendar {} 138 | #calendar_wrap {} 139 | #calendar_wrap th {} 140 | #calendar_wrap td {} 141 | #wp-calendar tr td {} 142 | #wp-calendar caption {} 143 | #wp-calendar a {} 144 | #wp-calendar #today {} 145 | #wp-calendar #prev {} 146 | #wp-calendar #next {} 147 | #wp-calendar #next a {} 148 | #wp-calendar #prev a {} 149 | .widget_categories {} 150 | .widget_categories ul {} 151 | .widget_categories ul li {} 152 | .widget_categories ul ul.children {} 153 | .widget_categories a {} 154 | .widget_categories select{} 155 | .widget_categories select#cat {} 156 | .widget_categories select.postform {} 157 | .widget_categories option {} 158 | .widget_categories .level-0 {} 159 | .widget_categories .level-1 {} 160 | .widget_categories .level-2 {} 161 | .widget_categories .level-3 {} 162 | .recentcomments {} 163 | #recentcomments {} 164 | #recentcomments li {} 165 | #recentcomments li a {} 166 | .widget_recent_comments {} 167 | .widget_recent_entries {} 168 | .widget_recent_entries ul {} 169 | .widget_recent_entries ul li {} 170 | .widget_recent_entries ul li a {} 171 | .textwidget {} 172 | .widget_text {} 173 | .textwidget p {} 174 | 175 | /* ---------------------------------------------- 176 | WIDGETS 177 | ---------------------------------------------- */ 178 | .commentlist .reply {} 179 | .commentlist .reply a {} 180 | .commentlist .alt {} 181 | .commentlist .odd {} 182 | .commentlist .even {} 183 | .commentlist .thread-alt {} 184 | .commentlist .thread-odd {} 185 | .commentlist .thread-even {} 186 | .commentlist li ul.children .alt {} 187 | .commentlist li ul.children .odd {} 188 | .commentlist li ul.children .even {} 189 | .commentlist .vcard {} 190 | .commentlist .vcard cite.fn {} 191 | .commentlist .vcard span.says {} 192 | .commentlist .vcard img.photo {} 193 | .commentlist .vcard img.avatar {} 194 | .commentlist .vcard cite.fn a.url {} 195 | .commentlist .comment-meta {} 196 | .commentlist .comment-meta a {} 197 | .commentlist .commentmetadata {} 198 | .commentlist .commentmetadata a {} 199 | .commentlist .parent {} 200 | .commentlist .comment {} 201 | .commentlist .children {} 202 | .commentlist .pingback {} 203 | .commentlist .bypostauthor {} 204 | .commentlist .comment-author {} 205 | .commentlist .comment-author-admin {} 206 | .commentlist {} 207 | .commentlist li {} 208 | .commentlist li p {} 209 | .commentlist li ul {} 210 | .commentlist li ul.children li {} 211 | .commentlist li ul.children li.alt {} 212 | .commentlist li ul.children li.byuser {} 213 | .commentlist li ul.children li.comment {} 214 | .commentlist li ul.children li.depth-{id} {} 215 | .commentlist li ul.children li.bypostauthor {} 216 | .commentlist li ul.children li.comment-author-admin {} 217 | #cancel-comment-reply {} 218 | #cancel-comment-reply a {} 219 | #respond { } 220 | #reply-title { } 221 | #cancel-comment-reply-link { } 222 | #commentform { } 223 | #author { } 224 | #email { } 225 | #url { } 226 | #comment 227 | #submit 228 | .comment-notes { } 229 | .required { } 230 | .comment-form-author { } 231 | .comment-form-email { } 232 | .comment-form-url { } 233 | .comment-form-comment { } 234 | .form-allowed-tags { } 235 | .form-submit -------------------------------------------------------------------------------- /dashboard/change-footer-admin.php: -------------------------------------------------------------------------------- 1 | theandersonn. Powered by WordPress'; 8 | } 9 | 10 | add_filter('admin_footer_text', 'btwp_change_footer_admin'); -------------------------------------------------------------------------------- /dashboard/change-login-label-username.php: -------------------------------------------------------------------------------- 1 | labels; 23 | $labels->name = 'Mídias'; 24 | $labels->singular_name = 'Mídia'; 25 | $labels->add_new = 'Adicionar Mídia'; 26 | $labels->add_new_item = 'Adicionar Mídia'; 27 | $labels->edit_item = 'Editar Mídia'; 28 | $labels->new_item = 'Mídia'; 29 | $labels->view_item = 'Ver Mídia'; 30 | $labels->search_items = 'Buscar Mídias'; 31 | $labels->not_found = 'Nenhum Mídia encontrado'; 32 | $labels->not_found_in_trash = 'Nenhum Mídia encontrado no Lixo'; 33 | $labels->all_items = 'Todos Mídias'; 34 | $labels->menu_name = 'Mídias'; 35 | $labels->name_admin_bar = 'Mídias'; 36 | } -------------------------------------------------------------------------------- /dashboard/disable-drag-metabox-dashboard.php: -------------------------------------------------------------------------------- 1 | Bem vindo ao sistema do site nome da empresa! Precisa de Ajuda? Contate o desenvolvedor aqui. Para aceesar o nosso site, visite: Nome do Site

'; 12 | } 13 | 14 | add_action('wp_dashboard_setup', 'btwp_insert_custom_dashboard_widgets'); 15 | -------------------------------------------------------------------------------- /dashboard/insert-custom-toolbar-link.php: -------------------------------------------------------------------------------- 1 | 'andersonn', 8 | 'title' => 'Fale com Andersonn', 9 | 'href' => 'https://github.com/theandersonn', 10 | 'meta' => array( 11 | 'class' => 'andersonn', 12 | 'title' => 'Fale com Andersonn' 13 | ) 14 | ); 15 | $wp_admin_bar->add_node($args); 16 | } 17 | add_action('admin_bar_menu', 'btwp_insert_custom_toolbar_link', 999); -------------------------------------------------------------------------------- /dashboard/insert-custom-toolbar-menu-submenu.php: -------------------------------------------------------------------------------- 1 | add_menu( array( 11 | 'id' => 'my-item', 12 | 'title' => 'My Item', 13 | 'href' => '#', 14 | 'meta' => array( 15 | 'title' => __('My Item'), 16 | ), 17 | )); 18 | 19 | $admin_bar->add_menu( array( 20 | 'id' => 'my-sub-item', 21 | 'parent' => 'my-item', 22 | 'title' => 'My Sub Menu Item', 23 | 'href' => 'http://www.google.com', 24 | 'meta' => array( 25 | 'title' => __('My Sub Menu Item'), 26 | 'target' => '_blank', 27 | 'class' => 'my_menu_item_class' 28 | ), 29 | )); 30 | 31 | $admin_bar->add_menu( array( 32 | 'id' => 'my-second-sub-item', 33 | 'parent' => 'my-item', 34 | 'title' => 'My Second Sub Menu Item', 35 | 'href' => '#', 36 | 'meta' => array( 37 | 'title' => __('My Second Sub Menu Item'), 38 | 'target' => '_blank', 39 | 'class' => 'my_menu_item_class' 40 | ), 41 | )); 42 | 43 | } -------------------------------------------------------------------------------- /dashboard/insert-user-id-column.php: -------------------------------------------------------------------------------- 1 | .column-user_id{width: 5%}'; 28 | } -------------------------------------------------------------------------------- /dashboard/remove-dashboard-widgets.php: -------------------------------------------------------------------------------- 1 | roles[0] == 'author') //poderia ser: editor, contributor ou tipo de usuário customizado. 17 | { 18 | $excludes = array( 19 | 'edit-comments.php', // oculta menu de comentários 20 | 'themes.php', // oculta menu aparência 21 | 'upload.php', // oculta menu mídia 22 | 'edit.php', // oculta menu Posts 23 | 'tools.php', // oculta menu Ferramentas 24 | 'edit.php?post_type=portfolio' //oculta menu Portfolio (Custom Post Type) 25 | ); 26 | 27 | foreach ( $menu as $mkey => $m ) { 28 | 29 | foreach( $excludes as $exclude ){ 30 | $key = array_search( $exclude, $m ); 31 | if( $key ) unset( $menu[$mkey] ); 32 | } 33 | 34 | } 35 | 36 | } 37 | return $menu_order; 38 | } 39 | -------------------------------------------------------------------------------- /dashboard/restrict-admin-access.php: -------------------------------------------------------------------------------- 1 | caps ) ) { 11 | wp_redirect( get_bloginfo( 'url' ) ); 12 | exit; 13 | } 14 | 15 | } 16 | 17 | add_action('admin_init', 'btwp_restrict_admin_access', 1); -------------------------------------------------------------------------------- /dashboard/send-mail-post-pending.php: -------------------------------------------------------------------------------- 1 | red 9 | // updated => green 10 | echo '
'; 11 | } else { 12 | echo '
'; 13 | } 14 | 15 | echo "

$message

"; 16 | 17 | } 18 | 19 | add_action( 'admin_notices', 'btwp_show_admin_message' ); 20 | 21 | function btwp_show_admin_message() { 22 | btwp_show_message( "Mensagem de erro Blank Theme WP", true ); 23 | } 24 | -------------------------------------------------------------------------------- /dashboard/unregister-default-widgets.php: -------------------------------------------------------------------------------- 1 | classes ) ? array() : (array) $item->classes; 13 | 14 | $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item ) ); 15 | $class_names = ' class="' . esc_attr( $class_names ) . '"'; 16 | 17 | $output .= $indent . '
  • '; 11 | echo 'Home'; 12 | echo " »
  • "; 13 | 14 | if ( is_category() || is_single() ) { 15 | echo '
  • '; 16 | the_category('
  • '); 17 | 18 | if ( is_single() ) { 19 | echo "
  • "; 20 | the_title(); 21 | echo '
  • '; 22 | } 23 | 24 | } elseif ( is_page() ) { 25 | echo '
  • '; 26 | echo the_title(); 27 | echo '
  • '; 28 | } 29 | } 30 | 31 | elseif ( is_tag() ) { single_tag_title(); } 32 | elseif ( is_day() ) { echo"
  • Arquivo(s) para "; the_time('F jS, Y'); echo'
  • '; } 33 | elseif ( is_month() ) { echo"
  • Arquivo(s) para "; the_time('F, Y'); echo'
  • '; } 34 | elseif ( is_year() ) { echo"
  • Arquivo(s) para "; the_time('Y'); echo'
  • '; } 35 | elseif ( is_author() ) { echo"
  • Arquivo(s) do autor"; echo'
  • '; } 36 | elseif ( isset($_GET['paged'] ) && !empty($_GET['paged'])) { echo "
  • Arquivo(s)"; echo'
  • '; } 37 | elseif ( is_search() ) { echo"
  • Resultado(s) da busca"; echo'
  • '; } 38 | echo ''; 39 | } 40 | 41 | ?> 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /navigation/insert-dimox-breadcrumbs.php: -------------------------------------------------------------------------------- 1 | '; // the opening wrapper tag 24 | $wrap_after = '
    '; // the closing wrapper tag 25 | $sep = '›'; // separator between crumbs 26 | $sep_before = ''; // tag before separator 27 | $sep_after = ''; // tag after separator 28 | $show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show 29 | $show_on_home = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show 30 | $show_current = 1; // 1 - show current page title, 0 - don't show 31 | $before = ''; // tag before the current crumb 32 | $after = ''; // tag after the current crumb 33 | /* === END OF OPTIONS === */ 34 | 35 | global $post; 36 | $home_link = home_url('/'); 37 | $link_before = ''; 38 | $link_after = ''; 39 | $link_attr = ' itemprop="url"'; 40 | $link_in_before = ''; 41 | $link_in_after = ''; 42 | $link = $link_before . '' . $link_in_before . '%2$s' . $link_in_after . '' . $link_after; 43 | $frontpage_id = get_option('page_on_front'); 44 | $parent_id = $post->post_parent; 45 | $sep = ' ' . $sep_before . $sep . $sep_after . ' '; 46 | 47 | if (is_home() || is_front_page()) { 48 | 49 | if ($show_on_home) echo $wrap_before . '' . $text['home'] . '' . $wrap_after; 50 | 51 | } else { 52 | 53 | echo $wrap_before; 54 | if ($show_home_link) echo sprintf($link, $home_link, $text['home']); 55 | 56 | if ( is_category() ) { 57 | $cat = get_category(get_query_var('cat'), false); 58 | if ($cat->parent != 0) { 59 | $cats = get_category_parents($cat->parent, TRUE, $sep); 60 | $cats = preg_replace("#^(.+)$sep$#", "$1", $cats); 61 | $cats = preg_replace('#]+)>([^<]+)<\/a>#', $link_before . '' . $link_in_before . '$2' . $link_in_after .'' . $link_after, $cats); 62 | if ($show_home_link) echo $sep; 63 | echo $cats; 64 | } 65 | if ( get_query_var('paged') ) { 66 | $cat = $cat->cat_ID; 67 | echo $sep . sprintf($link, get_category_link($cat), get_cat_name($cat)) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after; 68 | } else { 69 | if ($show_current) echo $sep . $before . sprintf($text['category'], single_cat_title('', false)) . $after; 70 | } 71 | 72 | } elseif ( is_search() ) { 73 | if (have_posts()) { 74 | if ($show_home_link && $show_current) echo $sep; 75 | if ($show_current) echo $before . sprintf($text['search'], get_search_query()) . $after; 76 | } else { 77 | if ($show_home_link) echo $sep; 78 | echo $before . sprintf($text['search'], get_search_query()) . $after; 79 | } 80 | 81 | } elseif ( is_day() ) { 82 | if ($show_home_link) echo $sep; 83 | echo sprintf($link, get_year_link(get_the_time('Y')), get_the_time('Y')) . $sep; 84 | echo sprintf($link, get_month_link(get_the_time('Y'), get_the_time('m')), get_the_time('F')); 85 | if ($show_current) echo $sep . $before . get_the_time('d') . $after; 86 | 87 | } elseif ( is_month() ) { 88 | if ($show_home_link) echo $sep; 89 | echo sprintf($link, get_year_link(get_the_time('Y')), get_the_time('Y')); 90 | if ($show_current) echo $sep . $before . get_the_time('F') . $after; 91 | 92 | } elseif ( is_year() ) { 93 | if ($show_home_link && $show_current) echo $sep; 94 | if ($show_current) echo $before . get_the_time('Y') . $after; 95 | 96 | } elseif ( is_single() && !is_attachment() ) { 97 | if ($show_home_link) echo $sep; 98 | if ( get_post_type() != 'post' ) { 99 | $post_type = get_post_type_object(get_post_type()); 100 | $slug = $post_type->rewrite; 101 | printf($link, $home_link . '/' . $slug['slug'] . '/', $post_type->labels->singular_name); 102 | if ($show_current) echo $sep . $before . get_the_title() . $after; 103 | } else { 104 | $cat = get_the_category(); $cat = $cat[0]; 105 | $cats = get_category_parents($cat, TRUE, $sep); 106 | if (!$show_current || get_query_var('cpage')) $cats = preg_replace("#^(.+)$sep$#", "$1", $cats); 107 | $cats = preg_replace('#]+)>([^<]+)<\/a>#', $link_before . '' . $link_in_before . '$2' . $link_in_after .'' . $link_after, $cats); 108 | echo $cats; 109 | if ( get_query_var('cpage') ) { 110 | echo $sep . sprintf($link, get_permalink(), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after; 111 | } else { 112 | if ($show_current) echo $before . get_the_title() . $after; 113 | } 114 | } 115 | 116 | // custom post type 117 | } elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) { 118 | $post_type = get_post_type_object(get_post_type()); 119 | if ( get_query_var('paged') ) { 120 | echo $sep . sprintf($link, get_post_type_archive_link($post_type->name), $post_type->label) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after; 121 | } else { 122 | if ($show_current) echo $sep . $before . $post_type->label . $after; 123 | } 124 | 125 | } elseif ( is_attachment() ) { 126 | if ($show_home_link) echo $sep; 127 | $parent = get_post($parent_id); 128 | $cat = get_the_category($parent->ID); $cat = $cat[0]; 129 | if ($cat) { 130 | $cats = get_category_parents($cat, TRUE, $sep); 131 | $cats = preg_replace('#]+)>([^<]+)<\/a>#', $link_before . '' . $link_in_before . '$2' . $link_in_after .'' . $link_after, $cats); 132 | echo $cats; 133 | } 134 | printf($link, get_permalink($parent), $parent->post_title); 135 | if ($show_current) echo $sep . $before . get_the_title() . $after; 136 | 137 | } elseif ( is_page() && !$parent_id ) { 138 | if ($show_current) echo $sep . $before . get_the_title() . $after; 139 | 140 | } elseif ( is_page() && $parent_id ) { 141 | if ($show_home_link) echo $sep; 142 | if ($parent_id != $frontpage_id) { 143 | $breadcrumbs = array(); 144 | while ($parent_id) { 145 | $page = get_page($parent_id); 146 | if ($parent_id != $frontpage_id) { 147 | $breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID)); 148 | } 149 | $parent_id = $page->post_parent; 150 | } 151 | $breadcrumbs = array_reverse($breadcrumbs); 152 | for ($i = 0; $i < count($breadcrumbs); $i++) { 153 | echo $breadcrumbs[$i]; 154 | if ($i != count($breadcrumbs)-1) echo $sep; 155 | } 156 | } 157 | if ($show_current) echo $sep . $before . get_the_title() . $after; 158 | 159 | } elseif ( is_tag() ) { 160 | if ( get_query_var('paged') ) { 161 | $tag_id = get_queried_object_id(); 162 | $tag = get_tag($tag_id); 163 | echo $sep . sprintf($link, get_tag_link($tag_id), $tag->name) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after; 164 | } else { 165 | if ($show_current) echo $sep . $before . sprintf($text['tag'], single_tag_title('', false)) . $after; 166 | } 167 | 168 | } elseif ( is_author() ) { 169 | global $author; 170 | $author = get_userdata($author); 171 | if ( get_query_var('paged') ) { 172 | if ($show_home_link) echo $sep; 173 | echo sprintf($link, get_author_posts_url($author->ID), $author->display_name) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after; 174 | } else { 175 | if ($show_home_link && $show_current) echo $sep; 176 | if ($show_current) echo $before . sprintf($text['author'], $author->display_name) . $after; 177 | } 178 | 179 | } elseif ( is_404() ) { 180 | if ($show_home_link && $show_current) echo $sep; 181 | if ($show_current) echo $before . $text['404'] . $after; 182 | 183 | } elseif ( has_post_format() && !is_singular() ) { 184 | if ($show_home_link) echo $sep; 185 | echo get_post_format_string( get_post_format() ); 186 | } 187 | 188 | echo $wrap_after; 189 | 190 | } 191 | } // end of dimox_breadcrumbs() 192 | 193 | // INSIRA 194 | 195 | 196 | 197 | 215 | -------------------------------------------------------------------------------- /page/insert-tag-pages.php: -------------------------------------------------------------------------------- 1 | posts ); 8 | 9 | $page = $the_query->posts; 10 | 11 | for ($p = 0; $p < $count; $p++) { 12 | $ids[$p] = $page[$p]->ID; 13 | } 14 | 15 | if($count == 2) : 16 | for($p = 0; $p < $count; $p++) { 17 | if($id_atual == $ids[$p]) : 18 | if($p > 0) : 19 | $a = $p - 1; 20 | echo ""; 21 | else : 22 | $pr = $p + 1; 23 | echo ""; 24 | endif; 25 | endif; 26 | } 27 | elseif($count >= 3) : 28 | for($p = 0; $p < $count; $p++) { 29 | if($id_atual == $ids[$p]) : 30 | if($p == 0) : 31 | $pr = $p + 1; 32 | echo ""; 33 | elseif($count - $p == 1) : 34 | $a = $p - 1; 35 | echo ""; 36 | else : 37 | $a = $p - 1; 38 | echo ""; 39 | $pr = $p + 1; 40 | echo ""; 41 | endif; 42 | endif; 43 | } 44 | endif; 45 | 46 | wp_reset_postdata(); 47 | } 48 | 49 | //COLOCAR ESTE CÓDIGO QUE ESTA COMENTADO NA TEMPLATE DE PÁGINA 50 | // $args = array( 51 | // 'tag' => get_option('periodo'), 52 | // 'post_type' => 'page', 53 | // 'meta_key' => 'especial' 54 | // ); 55 | 56 | // $id_atual = $post->ID; 57 | // $the_query = new WP_Query( $args ); 58 | -------------------------------------------------------------------------------- /post/after-all-post-content.php: -------------------------------------------------------------------------------- 1 | Conteúdo personalizado no final de todos os posts

    '; 12 | } 13 | 14 | return $content; 15 | } -------------------------------------------------------------------------------- /post/category-count.php: -------------------------------------------------------------------------------- 1 | count; 5 | } 6 | 7 | // echo categoryCount('1'); 8 | // echo categoryCount('9'); 9 | // echo categoryCount('8'); 10 | // echo categoryCount('10'); -------------------------------------------------------------------------------- /post/change-post-label.php: -------------------------------------------------------------------------------- 1 | labels; 29 | $labels->name = 'Notícias'; 30 | $labels->singular_name = 'Notícias'; 31 | $labels->add_new = 'Nova notícia'; 32 | $labels->add_new_item = 'Nova notícia'; 33 | $labels->edit_item = 'Editar'; 34 | $labels->new_item = 'Nova notícia'; 35 | $labels->view_item = 'Visualizar'; 36 | $labels->search_items = 'Buscar notícias'; 37 | $labels->not_found = 'Nada encontrado'; 38 | $labels->not_found_in_trash = 'Nada na lixeira'; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /post/count-publish-posts.php: -------------------------------------------------------------------------------- 1 | publish; 5 | } -------------------------------------------------------------------------------- /post/count-view-posts.php: -------------------------------------------------------------------------------- 1 | ID ); 8 | $title = substr( $title, 0, $char ); 9 | 10 | echo $title; 11 | 12 | } 13 | 14 | /* */ -------------------------------------------------------------------------------- /post/custom-post-type.php: -------------------------------------------------------------------------------- 1 | PORTFÓLIO 4 | --------------------------------------------------------------*/ 5 | add_action('init', 'btwp_custom_post_portfolio'); 6 | 7 | function btwp_custom_post_portfolio(){ 8 | $labels = array( 9 | 'name' => 'Portfólio', 10 | 'singular_name' => 'Portfólio', 11 | 'add_new' => 'Adicionar novo', 12 | 'add_new_item' => 'Adicionar novo Job', 13 | 'edit_item' => 'Editar Job', 14 | 'new_item' => 'Novo Job', 15 | 'all_items' => 'Todos os Jobs', 16 | 'view_item' => 'Visualizar Job', 17 | 'search_items' => 'Procurar Job', 18 | 'not_found' => 'Nenhum Job encontrado', 19 | 'not_found_in_trash' => 'Nenhum Job encontrado na lixeira', 20 | 'parent_item_colom' => '', 21 | 'menu_name' => 'Portfólio' 22 | ); 23 | 24 | $args = array( 25 | 'labels' => $labels, 26 | 'public' => true, 27 | 'has_archive' => true, 28 | 'menu_icon' => 'dashicons-images-alt2', // https://developer.wordpress.org/resource/dashicons/ 29 | 'menu_position' => 5, 30 | 'supports' => array ('title', 'editor', 'thumbnail', 'excerpt', 'comments') 31 | ); 32 | 33 | register_post_type('portfolio', $args); 34 | } 35 | 36 | // MODIFICA MENSAGENS DE ATUALIZAÇÃO 37 | add_filter('post_updated_messages', 'btwp_updated_messages'); 38 | 39 | function btwp_updated_messages ($messages){ 40 | global $post_ID; 41 | 42 | $messages['portfolio'] = array( 43 | 0 => '', 44 | 1 => 'Job Atualizado. Visualizar Job', 45 | 4 => 'Job Atualizado.', 46 | 6 => 'Job Publicado. Visualizar Job', 47 | 7 => 'Job Salvo.' 48 | ); 49 | 50 | return $messages; 51 | } 52 | 53 | /*-------------------------------------------------------------- 54 | REGISTRA TAXONOMIES -> PORTFÓLO - CATEGORY 55 | --------------------------------------------------------------*/ 56 | add_action('init', 'btwp_taxonomies_portfolio_category'); 57 | 58 | function btwp_taxonomies_portfolio_category(){ 59 | 60 | $labels = array( 61 | 'name' => 'Categorias', 62 | 'singular_name' => 'Categoria', 63 | 'add_new' => 'Adicionar nova', 64 | 'add_new_item' => 'Adicionar nova Categoria', 65 | 'edit_item' => 'Editar Categoria', 66 | 'new_item' => 'Nova Categoria', 67 | 'all_items' => 'Todas as Categorias', 68 | 'view_item' => 'Visualizar Categoria', 69 | 'search_items' => 'Procurar Categoria', 70 | 'not_found' => 'Nenhuma Categoria encontrada', 71 | 'not_found_in_trash' => 'Nenhuma Categoria encontrada na lixeira', 72 | 'parent_item_colom' => '', 73 | 'menu_name' => 'Categorias' 74 | ); 75 | 76 | $args = array( 77 | 'labels' => $labels, 78 | 'hierarchical' => true, 79 | 'show_admin_column' => true 80 | ); 81 | 82 | register_taxonomy('portfolio_category', 'portfolio', $args); 83 | } 84 | 85 | /*-------------------------------------------------------------- 86 | EXIBE FILTRO POR CATEGORIA 87 | --------------------------------------------------------------*/ 88 | add_action( 'restrict_manage_posts', 'btwp_show_filter_portfolio_category' ); 89 | 90 | function btwp_show_filter_portfolio_category() { 91 | 92 | global $typenow; 93 | $taxonomy = 'portfolio_category'; 94 | 95 | if( $typenow == 'portfolio' ){ 96 | $filters = array($taxonomy); 97 | 98 | foreach ($filters as $tax_slug) { 99 | $tax_obj = get_taxonomy($tax_slug); 100 | $tax_name = $tax_obj->labels->name; 101 | $terms = get_terms($tax_slug); 102 | 103 | echo ""; 111 | } 112 | } 113 | } 114 | 115 | /*-------------------------------------------------------------- 116 | REGISTRA TAXONOMIES -> PORTFÓLO - TAG 117 | --------------------------------------------------------------*/ 118 | add_action('init', 'btwp_taxonomies_portfolio_tag'); 119 | 120 | function btwp_taxonomies_portfolio_tag(){ 121 | 122 | $labels = array( 123 | 'name' => 'Tags', 124 | 'singular_name' => 'Tag', 125 | 'add_new' => 'Adicionar nova', 126 | 'add_new_item' => 'Adicionar nova Tag', 127 | 'edit_item' => 'Editar Tag', 128 | 'new_item' => 'Nova Tag', 129 | 'all_items' => 'Todas as Tags', 130 | 'view_item' => 'Visualizar Tag', 131 | 'search_items' => 'Procurar Tag', 132 | 'not_found' => 'Nenhuma Tag encontrada', 133 | 'not_found_in_trash' => 'Nenhuma Tag encontrada na lixeira', 134 | 'parent_item_colom' => '', 135 | 'menu_name' => 'Tags' 136 | ); 137 | 138 | $args = array( 139 | 'labels' => $labels, 140 | 'hierarchical' => false, 141 | 'show_admin_column' => true, 142 | ); 143 | 144 | register_taxonomy('portfolio_tag', 'portfolio', $args); 145 | } 146 | 147 | /*-------------------------------------------------------------- 148 | EXIBE FILTRO POR TAG 149 | --------------------------------------------------------------*/ 150 | add_action( 'restrict_manage_posts', 'btwp_show_filter_portfolio_tag' ); 151 | 152 | function btwp_show_filter_portfolio_tag() { 153 | 154 | global $typenow; 155 | $taxonomy = 'portfolio_tag'; 156 | 157 | if( $typenow == 'portfolio' ){ 158 | $filters = array($taxonomy); 159 | 160 | foreach ($filters as $tax_slug) { 161 | $tax_obj = get_taxonomy($tax_slug); 162 | $tax_name = $tax_obj->labels->name; 163 | $terms = get_terms($tax_slug); 164 | 165 | echo ""; 173 | } 174 | } 175 | } 176 | 177 | /*-------------------------------------------------------------- 178 | INSERE METABOX 179 | --------------------------------------------------------------*/ 180 | add_action('add_meta_boxes', 'btwp_portfolio_link_box'); 181 | 182 | 183 | function btwp_portfolio_link_box(){ 184 | 185 | add_meta_box( 186 | 'portfolio_link_box', 187 | 'Link do Job', 188 | 'btwp_portfolio_link_content', 189 | 'portfolio', 190 | 'side', 191 | 'low' 192 | ); 193 | } 194 | 195 | // INSERE METABOX CAMPOS DE FORMULÁRIO 196 | function btwp_portfolio_link_content(){ 197 | 198 | // INSERE NONCES 199 | wp_nonce_field('portfolio_metabox_form_save', 'portfolio_link_box_content_nonce'); 200 | 201 | $link = get_post_meta( get_the_ID(), '_portfolio_link', true ) 202 | 203 | ?> 204 | 205 | 206 | 'portfolio', // cpt 236 | 'term' => 'portfolio_category', // taxonomia category registrada 237 | 'posts_per_page' => -1, 238 | 'paged' => $paged, 239 | 'tax_query' => array( 240 | array( 241 | 'taxonomy' => 'portfolio_tag', // taxonomia tag registrada 242 | 'field' => 'slug', 243 | 'terms' => 'sites' // tag inserida no admin 244 | ) 245 | ) 246 | ) 247 | ); 248 | ?> 249 | 250 | have_posts() ) : while( $args->have_posts() ) : $args->the_post(); ?> 251 | 252 | 253 | 254 | 255 | 256 | ID, '_portfolio_link', true);?> 257 | 258 | -------------------------------------------------------------------------------- /post/custom-result-search.php: -------------------------------------------------------------------------------- 1 | is_search ) { 6 | $query->set('post_type', 'post'); 7 | } 8 | return $query; 9 | } 10 | 11 | add_filter('pre_get_posts','search_filter'); 12 | } -------------------------------------------------------------------------------- /post/disable-comments-fields.php: -------------------------------------------------------------------------------- 1 | 4 |

    Última modificação:

    5 | -------------------------------------------------------------------------------- /post/embedded-youtube-responsive.js: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------- 2 | EMBEDDED YOUTUBE RESPONSIVE 3 | --------------------------------------------------------------*/ 4 | jQuery(function(){ 5 | var all_oembed_videos = jQuery("iframe[src*='youtube'], iframe[src*='vimeo']"); 6 | all_oembed_videos.each(function(){ 7 | jQuery(this).removeAttr('height').removeAttr('width').wrap( "
    " ); 8 | }); 9 | }); -------------------------------------------------------------------------------- /post/insert-disqus.php: -------------------------------------------------------------------------------- 1 | 6 | '; 12 | } 13 | 14 | // how to use 15 | -------------------------------------------------------------------------------- /post/insert-more-buttons-editor.php: -------------------------------------------------------------------------------- 1 | query_vars['paged'] > 1 ? $current = $wp_query->query_vars['paged'] : $current = 1; 10 | $pagination = array( 11 | 'base' => @add_query_arg('page','%#%'), 12 | 'format' => '', 13 | 'total' => $wp_query->max_num_pages, 14 | 'current' => $current, 15 | 'show_all' => true, 16 | 'type' => 'list' 17 | ); 18 | 19 | if ( $wp_rewrite->using_permalinks() ) $pagination['base'] = user_trailingslashit( trailingslashit( remove_query_arg( 's', get_pagenum_link( 1 ) ) ) . 'page/%#%/', 'paged' ); 20 | if ( !empty($wp_query->query_vars['s']) ) $pagination['add_args'] = array( 's' => get_query_var( 's' ) ); 21 | echo ''; 22 | 23 | } -------------------------------------------------------------------------------- /post/rename-post-formats.php: -------------------------------------------------------------------------------- 1 | 6 |

    Test Shortcode

    7 | 8 | '; 9 | } 10 | 11 | add_shortcode('example', 'example_shortcode'); 12 | 13 | // How to use 14 | // [example] 15 | // echo do_shortcode('[example]'); -------------------------------------------------------------------------------- /post/view-popular-posts.php: -------------------------------------------------------------------------------- 1 | 21 | 22 | 23 | 26 | 27 | 28 | 'nome-categoria', 32 | 'posts_per_page' => 3, 33 | 'meta_key' => 'wpb_post_views_count', 34 | 'orderby' => 'meta_value' 35 | ) 36 | ); 37 | ?> 38 | 39 | have_posts() ) : $popularPost->the_post(); ?> 40 | 41 | -------------------------------------------------------------------------------- /robots/robots.md: -------------------------------------------------------------------------------- 1 | **Configuração Robots.txt** 2 | ```txt 3 | 4 | User-agent: * 5 | # remova os diretorios 6 | Disallow: /wp-login.php 7 | Disallow: /wp-admin/ 8 | Disallow: /wp-includes/ 9 | Disallow: /wp-content/* 10 | Disallow: /author/ 11 | Disallow: /trackback/ 12 | Disallow: /comments/ 13 | Disallow: /xml/ 14 | Disallow: /page/* 15 | Disallow: /uncategorized/ 16 | Disallow: */trackback 17 | Disallow: */feed/ 18 | Disallow: */comments 19 | Disallow: */comment-page-*/ 20 | Disallow: */comment-page-*/* 21 | Disallow: */function.simplexml-load-file 22 | Disallow: /download/pt_BR.po 23 | Allow: /wp-content/uploads 24 | Allow: /tag/* 25 | 26 | Disallow: /*.inc$ 27 | Disallow: /*.gz$ 28 | Disallow: /*.wmv$ 29 | Disallow: /*.cgi$ 30 | Disallow: /*.xhtml$ 31 | 32 | ``` -------------------------------------------------------------------------------- /theme-suport/activate-maintenace-mode.php: -------------------------------------------------------------------------------- 1 | Erro: Nome de usuário ou Senha está incorreto.'; 9 | } 10 | -------------------------------------------------------------------------------- /theme-suport/deregister-jquery.php: -------------------------------------------------------------------------------- 1 | name; 9 | 10 | // Theme title 11 | echo $theme->title; 12 | 13 | // Theme version 14 | echo $theme->version; 15 | 16 | // Get parent theme name 17 | echo $theme->parent_theme; 18 | 19 | // Get the path to the template directory 20 | echo $theme->template_dir; 21 | 22 | // Get the path to the stylesheet 23 | echo $theme->stylesheet_dir; 24 | 25 | // Get the template directory name 26 | echo $theme->template; 27 | 28 | // Get the stylesheet directory name 29 | echo $theme->stylesheet; 30 | 31 | // Return the URL to the screenshot 32 | echo $theme->screenshot; 33 | 34 | // Get the theme description 35 | echo $theme->description; 36 | 37 | // Get the theme author name 38 | echo $theme->author; 39 | 40 | // Get the theme tags 41 | echo $theme->tags; -------------------------------------------------------------------------------- /theme-suport/hide-usernames-from-comment-class.php: -------------------------------------------------------------------------------- 1 | $class ) { 10 | if(strstr( $class, "comment-author-" ) ) { 11 | unset( $classes[$key] ); 12 | } 13 | } 14 | 15 | return $classes; 16 | 17 | } -------------------------------------------------------------------------------- /theme-suport/insert-random-error-messages.php: -------------------------------------------------------------------------------- 1 | Você não passará!', 11 | 'Contate o administrador!', 12 | 'Xi... errou!', 13 | 'Tentando trapacear?', 14 | 'Precisa de ajuda?', 15 | 'Precisa de ajuda?', 16 | ); 17 | 18 | return $custom_error_messages[array_rand($custom_error_messages)];; 19 | } 20 | -------------------------------------------------------------------------------- /theme-suport/register-sidebar.php: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------------------------- 2 | REGISTER SIDEBARS 3 | --------------------------------------------------------------*/ 4 | register_sidebar( 5 | array( 6 | 'name' => 'Barra lateral', 7 | 'id' => 'barra-lateral', 8 | 'before_widget' => '
    ', 9 | 'after_widget' => '
    ', 10 | 'description' => 'Widgets in this area are displayed in the sidebar' 11 | ) 12 | ); -------------------------------------------------------------------------------- /theme-suport/remove-default-image-thumbnails.php: -------------------------------------------------------------------------------- 1 | widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) ); 35 | } 36 | -------------------------------------------------------------------------------- /theme-suport/remove-max-srcset-image-width.php: -------------------------------------------------------------------------------- 1 | widgets['WP_Widget_Recent_Comments'], 'recent_comments_style' ) 7 | ); 8 | } 9 | add_action( 'widgets_init', 'remove_recent_comment_style' ); 10 | ?> -------------------------------------------------------------------------------- /theme-suport/remove-theme-suport.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Site under construction 7 | 12 | 13 | 14 |
    15 | 16 |
    17 | 18 | -------------------------------------------------------------------------------- /tips/tips.md: -------------------------------------------------------------------------------- 1 | **Link - back button** 2 | ```txt 3 | « Back 4 | ``` -------------------------------------------------------------------------------- /wp-config/wp-config.md: -------------------------------------------------------------------------------- 1 | **Atualização automática do WordPress - desabilitar** 2 | ```php 3 | define ( 'AUTOMATIC_UPDATER_DISABLED' , true); 4 | ``` 5 | 6 | **Chaves de segurança** 7 | ```php 8 | https://api.wordpress.org/secret-key/1.1/salt/ 9 | ``` 10 | 11 | **Contact form - remove BRs** 12 | ```php 13 | define ('WPCF7_AUTOP', false ); 14 | ``` 15 | 16 | **Debugging mode - ativa** 17 | ```php 18 | // Enable WP_DEBUG mode 19 | define( 'WP_DEBUG', true ); 20 | 21 | // Enable Debug logging to the /wp-content/debug.log file 22 | define( 'WP_DEBUG_LOG', true ); 23 | 24 | // Disable display of errors and warnings 25 | define( 'WP_DEBUG_DISPLAY', false ); 26 | @ini_set( 'display_errors', 0 ); 27 | 28 | // Use dev versions of core JS and CSS files (only needed if you are modifying these core files) 29 | define( 'SCRIPT_DEBUG', true ); 30 | ``` 31 | 32 | **Desabilita a edição de temas e plugins** 33 | ```php 34 | define('DISALLOW_FILE_EDIT', true); 35 | ``` 36 | **Desabilita edição e atualização de temas e plugins** 37 | ```php 38 | define( 'DISALLOW_FILE_MODS', true ); 39 | ``` 40 | **Solicitação FTP para instalar plugins - desabilita** 41 | ```php 42 | define('FS_METHOD','direct'); 43 | ``` 44 | 45 | **Revisões de posts - deleta todas** 46 | ```sql 47 | SQL DELETE FROM wp_posts 48 | WHERE post_type = “revision”; 49 | ``` 50 | 51 | **Revisões de posts - desativa** 52 | ```php 53 | define('WP_POST_REVISIONS', false ); 54 | ``` 55 | 56 | **Revisões de posts - limita o número** 57 | ```php 58 | define('WP_POST_REVISIONS', 3); 59 | ``` 60 | 61 | **Limita o tempo de auto save** 62 | ```php 63 | define ('AUTOSAVE_INTERVAL', 160); // segundos 64 | ``` 65 | 66 | **Limita o tempo que o conteúdo fica na lixeira** 67 | ```php 68 | define ('EMPTY_TRASH_DAYS', 7); // padrão 30 dias, 0 para desabilitar 69 | ``` 70 | **Inserir idioma** 71 | ```php 72 | define ('WPLANG', 'pt_BR'); 73 | ``` 74 | **Atualiza a URL base do WordPress para conter o HTTPS** 75 | ```php 76 | define('WP_HOME','https://site.com/'); 77 | define('WP_SITEURL','https://site.com/'); 78 | ``` --------------------------------------------------------------------------------