This article is about cristidraghici/wp-just-an-admin-button. The content is about taking it from the form of […]
Showing posts from Tag: Wordpress
show all postsMost people who are interested in news about WordPress are quite curious about the new […]
In a continuous effort to improve my website, I have added the AMP plugin and […]
This is a plugin for WordPress which disables the upper admin area in the font […]
One way would be to edit your site’s .htaccess file and add the following:
1 2 3 4 5 |
php_value upload_max_filesize 64M php_value post_max_size 64M php_value max_execution_time 300 php_value max_input_time 300 |
[…]
This article is about publishing a plugin to the WordPress Repository. I use TortoiseGIT on […]
Add the following code to your theme’s functions.php file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
/* * Show the thumbnail and the title of a WP post with bootstrap media */ // Add the shortcode add_shortcode('show_post_wp_bm', 'get_post_title_and_thumbnail_in_boostrap_media'); // Create the function if(!function_exists('get_post_title_and_thumbnail_in_boostrap_media')): function get_post_title_and_thumbnail_in_boostrap_media($atts, $content=null) { // Get the attributes provided extract(shortcode_atts(array( "id" => null ), $atts)); // Check if an id was specified and that the post with that id exists if (is_numeric($id)) { $post = get_post($id); } // Get the data if ($post != null) { $title = apply_filters ( 'wp_title', $post->post_title); $html = ''; $html .= '<div class="media">'; $html .= '<div class="media-left media-middle">'; $html .= '<a href="'.get_permalink($post).'" title="'.$title.'">'; $html .= get_the_post_thumbnail($post, 'thumbnail'); $html .= '</a>'; $html .= '</div>'; $html .= '<div class="media-body">'; $html .= '<a href="'.get_permalink($post).'" title="'.$title.'">'; $html .= '<h4 class="media-heading">'.$title.'</h4>'; $html .= '</a>'; //$html .= '...'; $html .= '</div>'; $html .= '</div>'; // Return the content return html_entity_decode($html); } // Return an error return '[show_post_wp_bm] Invalid ID: ' . $id; } endif; |
An interesting tutorial about WordPress shortcodes can be found here: http://wordpress.stackexchange.com/questions/1567/best-collection-of-code-for-your-functions-php-file/5741
Add the following code to your theme’s functions.php file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
// Categories walker class Walker_Categories_Template extends Walker_Category { function start_lvl(&$output, $depth=1, $args=array()) { $output .= "\n<ul class=\"list-group\">\n"; } function end_lvl(&$output, $depth=0, $args=array()) { $output .= "</ul>\n"; } function start_el(&$output, $item, $depth=0, $args=array()) { $output .= "<li class=\"list-group-item\"><a href=\"". esc_url( get_category_link( $item->term_id ) ) ."\" title=\"".esc_attr( $item->name )."\"><span class=\"badge pull-right\">".esc_attr($item->count)."</span>".esc_attr( $item->name ); } function end_el(&$output, $item, $depth=0, $args=array()) { $output .= "</a></li>\n"; } } |
Use the categories list function […]
To allow HTML code in the taxonomy description in WordPress, add the following code to […]
To remove the pages from the search results, use the following code:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
/* Remove pages from search results */ function SearchFilter($query) { // Check if query is search if ($query->is_search) { // Add the wanted post type $query->set('post_type', 'post'); } // Return the query return $query; } add_filter('pre_get_posts','SearchFilter'); |
To disable the trash for wordpress, edit your ./wp-config.php file and add the following line: […]