#Postexcerpt
Explore tagged Tumblr posts
kitauthor · 6 months ago
Text
The Trouble with AIOSEO and Divi
Tumblr media
If you have a WordPress blog, then there's a good chance you use a SEO plugin. One of the more popular is AIOSEO, available in both free and paid editions. And it claims to be compatible with Divi, a popular theme and one I've used for years. The problem is that AIOSEO and Divi don't quite play nicely together. Let me explain the trouble with AIOSEO's "compatibility" with Divi.
What's the issue?
As a general rule WordPress uses the first lines of your blog as a post excerpt. This is what shows up under the image when you share the link on social media or what you see in a search engine result. However, SEO plugins change this behavior. By default AIOSEO also uses the post excerpt in the meta description, which is what this part of your website's appearance is called. However, if you use the Divi Builder to build your post, then instead of the first few lines, your excerpt will look like code (usually a square bracket followed by information that's only legible to the plugin]. And this doesn't happen just on posts, but also on pages. If you don't pay a lot of attention to SEO, and let's be honest, most authors are not SEO experts or even think about it. I know I didn't until I realized this was happening and wanted to improve my search engine optimization game, then your readers will see your post appears to be gobbledygook and not want to click. So how do you fix it? I reached out to AIOSEO's free support through the Wordpress.org forums, and they told me to uncheck a hidden setting that's automatically checked by default and then to check and make sure my meta description said post expert. It did. And when I completed those steps, which again, the average user wouldn't be familiar with... it still didn't work.
How I Fixed It
Beneath the space for a featured image there is a line that says "add an excerpt". If you click there a small box will come up. You can either type in the first 55 words of your post, which is what Wordpress is use in this space if another plugin, like AIOSEO doesn't change its behavior, or you can describe what the post is. For example, in my serial story updates which are members only, I'll explain that the post is a serial episode and how someone can read it. By paying attention to the excerpts in your posts and pages, your readers will have a better experience when you share this information online. Since AIOSEO is one of the more recommended SEO plugins, this is a good situation to be aware of. Read the full article
0 notes
draegerit · 4 years ago
Text
WordPress - Media Selector in Meta Box einbinden
Tumblr media
Wenn du eigene Plugins oder Themes für WordPress programmieren möchtest, dann kann es vorkommen das du den "Media Selector" von WordPress einbinden möchtest oder sogar musst.
Tumblr media
WordPress - einfache Meta Box mit Bild
Was ist der Media Selector?
Der Media Selector ist ein Fenster welches sich über deinen Inhalt legt und aus diesem kannst du ein Bild, Video oder eine Audiodatei wählen.
Tumblr media
WordPress - Media Selector Wenn du den WordPress Classic Editor benutzt, dann kannst du sogar aus diesem Dialog heraus eine Galerie zu deiner Seite / deinem Beitrag einfügen.
ein kleines Projekt mit dem WordPress Media Selector
Ich möchte dir nun gerne ein kleines Projekt zeigen mit welchem du in einer MetaBox ein Bild hinzufügen kannst. Das fertige Projekt kannst du am Ende dieses Beitrages herunterladen. eingesetzte Software & lokale Server Für die Programmierung nutze ich den kostenfreien Editor NotePad++ und als lokale Serverlösung XAMPP. Die kostenfreie, lokale Serverlösung XAMPP bietet eine MySQL Datenbank und einen Apache2 HTTP Server und noch ein paar weitere Programme welche wir jedoch hier nicht benötigen. WordPress Version Diesen Beitrag verfasse ich zu aktuellen Version 5.7 von WordPress. Da die Entwicklung von WordPress stätig weiter geht kann ich leider nicht garantieren dass, das Beispiel in einer zukünftigen Version vollumfänglich Lauffähig sein wird. externes JavaScript für den einfachen Zugriff auf den Media Selector Damit wir auf den WordPress Media Selector einfacher zugreifen können, nutze ich ein kleines JavaScript von Kelin Chauhan. var customMediaLibrary = window.wp.media({ frame: 'select', title: "'Bild wählen'", multiple: false, library: { order: 'DESC', orderby: 'date', type: 'image', search: null, uploadedTo: null }, button: { text: 'Fertig' } }); Dieses kleine Script speichern wir in dem Ordner "js" unter dem Dateinamen "mediaselector.js" und laden dieses Script in der functions.php. function admin_scripts() { wp_enqueue_media(); wp_enqueue_script( 'backend-mediaselector', get_template_directory_uri() . '/js/mediaselector.js', array(), '20210407', true ); } add_action('admin_enqueue_scripts', 'admin_scripts'); erstellen eines Custom Post Types In diesem kleinen Projekt möchte ich Custom Post Type und an diesem wiederum eine Meta Box erstellen um dann ein Bild zu speichern. function custom_post_type() { $labels = array( 'name' => 'Beispiel Einträge', 'singular_name' => 'Beispiel', 'menu_name' => 'Beispiel', 'parent_item_colon' => '', 'all_items' => 'Alle Einträge', 'view_item' => 'Eintrag ansehen', 'add_new_item' => 'Neuer Eintrag', 'add_new' => 'Hinzufügen', 'edit_item' => 'Eintrag bearbeiten', 'update_item' => 'Update Eintrag', 'search_items' => '', 'not_found' => '', 'not_found_in_trash' => '', ); $rewrite = array( 'slug' => 'beispiel', 'with_front' => true, 'pages' => true, 'feeds' => true, ); $args = array( 'labels' => $labels, 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'comments', 'trackbacks', ), 'taxonomies' => array( 'category', 'post_tag' ), 'hierarchical' => false, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 5, 'can_export' => false, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'rewrite' => $rewrite, 'capability_type' => 'page', ); register_post_type( 'beispiel', $args ); } add_action( 'init', 'custom_post_type', 0 ); entfernen der überzähligen Meta-Boxen Für dieses Beispiel benötigen wir lediglich eine einzige Meta Box an unserem Custom Post Type daher möchte ich die überzähligen Meta Boxen entfernen.
Tumblr media
WordPress default Meta Boxen an einem Beitrag Für das entfernen der default Meta Boxen müssen wir diese in der Datei functions.php ... function remove_meta_boxes() { remove_meta_box('postcustom', 'beispiel', 'core'); remove_meta_box('commentsdiv', 'beispiel', 'core'); remove_meta_box('postexcerpt', 'beispiel', 'core'); remove_meta_box('trackbacksdiv', 'beispiel', 'core'); remove_meta_box('commentstatusdiv', 'beispiel', 'core'); } add_action( 'admin_menu', 'remove_meta_boxes' ); erstellen einer Meta Box In einer Meta Box kannst du zusätzliche Felder für dein Custom Post Type oder aber auch für eine Seite / Beitrag hinterlegen. Diese Felder kannst du dann wiederum in deiner Seite auslesen und darstellen.
Tumblr media
eine einfache Meta Box in WordPress Für die Erstellung einer Meta Box müssen wir die "Action Hook" admin_menu implementieren und dort auf eine Funktion verweisen. In dieser Funktion rufen wir nun die Funktion "add_meta_box" von WordPress auf und übergeben die Paramater. Die wichtigsten Parameter sind: - sample_metabox_callback - die Funktion welche aufgerufen werden soll, wenn die Meta Box erstellt wird - beispiel - unser zuvor erstelltes Custom Post Type, hier könnte auch post oder page stehen, - side - die Position der Meta Box - core - Reihenfolge in der Position function add_metabox() { add_meta_box( 'sample_metabox', // metabox ID 'Sample - Meta Box with Media Selector', // title 'sample_metabox_callback', // callback function 'beispiel', // post type or post types in array 'side', // position (normal, side, advanced) 'core' // priority (default, low, high, core) ); } add_action( 'admin_menu', 'add_metabox' ); In der Callback Funktion bauen wir die Eingabefelder für die Meta Box auf. Die Meta Box mit seinen Funktionen wie Toggle und Rahmen brauchen wir nicht extra programmieren / stylen, dieses wird uns quasi von WordPress geliefert. function sample_metabox_callback( $post ) { $image_url = esc_attr(get_post_meta( $post->ID, 'imagePath', true )); echo ' Bild öffnen '; ?> Read the full article
0 notes
044-eu · 5 years ago
Text
Wordpress, how to remove the meta box of the Super Socializer plugin in the post editing panel
Tumblr media
You may need to hide a metabox. Surely the intention of the programmer when inserting a metabox is, in many cases but not all, to improve the service. Not all webmasters appreciate the fact that simple users can control site features even for security reasons. From my point of view all addons should give the opportunity to choose "for free" what elements make visible to simple users. Whatever the motivation, I'll now explain how to remove the metabox of the super socialzer plugin that is located within the editing panel of articles. In the functions.php file of your theme, you must enter the following code: if (!current_user_can('edit_pages')){ add_action('add_meta_boxes','my_remove_super_socializer',100000); } function my_remove_super_socializer_post_metabox(){ remove_meta_box('glossary_post_metabox','post','normal'); } add_action('admin_menu','wpdocs_remove_post_custom_fields'); if(is_admin()){ add_action('admin_menu','wpdocs_remove_meta_boxes'); } I recommend creating a child theme because otherwise, if you update the theme you will lose the change Avoid using the following standard code because it will give you problems: function remove_my_post_metaboxes(){ remove_meta_box('authordiv','post','normal'); remove_meta_box('commentstatusdiv','post','normal'); remove_meta_box('commentsdiv','post','normal'); remove_meta_box('postcustom','post','normal'); remove_meta_box('postexcerpt','post','normal'); remove_meta_box('revisionsdiv','post','normal'); remove_meta_box('slugdiv','post','normal'); remove_meta_box('trackbacksdiv','post','normal'); remove_meta_box('related_post_metabox','post','high'); } add_action('admin_menu','remove_my_post_metaboxes'); I tested this change with version 7.9.4 of the plugin. Before you almost change what you make sure you have a backup and know what you're doing. Read the full article
0 notes
044-eu · 5 years ago
Text
Wordpress, How to remove the glossary plugin meta box from the post editing panel
Tumblr media
Glossary, is a plugin that allows you to create a glossary of terms. It's quite complete software and also allows you to create external and internal links to the site without having to create an article. This plugin, creates a metabox in the section dedicated to editing articles (backoffice post wordpress). Someone may need to remove this metabox for certain reasons. Simply enter the following code at the end of function.php. if (!current_user_can('edit_pages')){ add_action('add_meta_boxes','my_remove_glossary_post_metabox',100000); } function my_remove_glossary_post_metabox(){ remove_meta_box('glossary_post_metabox','post','normal'); } add_action('admin_menu','wpdocs_remove_post_custom_fields'); if(is_admin()){ add_action('admin_menu','wpdocs_remove_meta_boxes'); } I suggest you create a child theme where you can insert this code. Avoid using the standard removal system below or you'll have problems. function remove_my_post_metabosex(){ remove_meta_box('authordiv','post','normal'); remove_meta_box('commentstatusdiv','post','normal'); remove_meta_box('commentsdiv','post','normal'); remove_meta_box('postcustom','post','normal'); remove_meta_box('postexcerpt','post','normal'); remove_meta_box('revisionsdiv','post','normal'); remove_meta_box('slugdiv','post','normal'); remove_meta_box('trackbacksdiv','post','normal'); remove_meta_box('related_post_metabox','post','high'); } add_action('admin_menu','remove_my_post_metaboxes'); I tried this change with the 1.4.11 plugin version. Before editing, make sure you make a backup, make sure you know what you're doing well, and make sure that function names don't conflict with other names already in your code. Use this article if you know what you're doing I don't take any responsibility. You can share the content of this article by creating a direct link without a "no follow" attribute to this page. Read the full article
0 notes
044-eu · 5 years ago
Text
Wordpress, how to remove the meta box of the plugin related post from the post editing panel
Tumblr media
This"related post"plugin adds related articles to the end of your articles. The plugin also allows you to filter by type and author articles by creating a metabox in the backend area. It can also be useful to disable this feature if you want to maintain a backend interface for publishing clean items and without too many features that might confuse the end user. If you want you can disable this feature for users so that they have the interface unlocked by entering the following code in the functions.php file: if (!current_user_can('edit_pages')){ add_action('add_meta_boxes','my_remove_related_post',100000); } function my_remove_remove_related_post(){ remove_meta_box('related_post','post','normal'); } add_action('admin_menu','wpdocs_remove_post_custom_fields'); if(is_admin()){ add_action('admin_menu','wpdocs_remove_meta_boxes'); } I suggest you create a child theme where you put this code. Subsequent updates may overwrite the code. The format I used also serves to remove other features in the post section, I wrote other articles about it. Avoid using this standard code to hide other metaboxes because it won't work in this case. function remove_my_post_metaboxes(){ remove_meta_box('authordiv','post','normal'); remove_meta_box('commentstatusdiv','post','normal'); remove_meta_box('commentsdiv','post','normal'); remove_meta_box('postcustom','post','normal'); remove_meta_box('postexcerpt','post','normal'); remove_meta_box('revisionsdiv','post','normal'); remove_meta_box('slugdiv','post','normal'); remove_meta_box('trackbacksdiv','post','normal'); remove_meta_box('related_post_metabox','post','high'); } add_action('admin_menu','remove_my_post_metaboxes'); I tried this change with the plugin version 2.0.2. Before you change Make sure you make a backup, make sure you know what you're doing well, and make sure that function names don't conflict with other names already in your code. Use this guide if you know what you're doing, I don't take any responsibility. Read the full article
0 notes