Open uw site huidige wp thema (kind) bestand functions.php en voeg daar de volgende code toe:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | add_filter('wpseo_sitemap_index', function () { $links = [ 'https://mysite.com/link1', 'https://mysite.com/link2', 'https://mysite.com/link3', 'https://mysite.com/link4', 'https://mysite.com/link5' ]; //also you can generate links by your own business logic $appended_text = ''; foreach ($links as $l) { $appended_text .= "<sitemap><loc>{$l}</loc></sitemap>"; } return $appended_text; }); |
Stel in array $links uw links in die u wilt toevoegen aan de sitemap van de site. Als u ontwikkelaar bent, kunt u uw eigen logica toevoegen voor het genereren van koppelingen. Lees ook over WooCommerce Products filtermodule 'SEO URL request'
Hier zijn enkele instructies en code die u kunt gebruiken voor het optimaliseren van de sitesnelheid die u hier kunt testen https://developers.google.com/speed/pagespeed/insights/?hl=nl Installeer plug-in Autoptimize en stel de volgende opties in: Installeer plug-in WP Super Cache Plug-in installeren JPEG- en PNG-afbeeldingen comprimeren Stel hier uw opties in '/wp-admin/options-general.php?page=tinify' Plug-in installeren Uitschakelen Insluiten Plug-in installeren Uitschakelen Emoji's (AVG-vriendelijk) Volgende toevoegen [...]
Interne serverfouten (fouten 5xx) worden vaak veroorzaakt door conflicten met plug-ins of themafuncties, dus als je toegang hebt tot je admin-paneel, probeer dan alle plug-ins te deactiveren om de oorzaak van de problemen te achterhalen. Als u geen toegang heeft tot het wp admin-paneel van uw site, probeer dan handmatig de plug-ins opnieuw in te stellen (geen toegang tot het dashboard vereist): door […]
Gebruik het volgende algoritme om te bepalen wat er precies niet werkt op uw WordPress-site na eventuele wijzigingen met kern, thema en / en plug-ins: maak een duplicaat van de site met behulp van plug-in https://wordpress.org/plugins/duplicator/ maak een test-subdomein op uw site met hostingpaneel installeer dubbele bundel op uw testsubdomein op het testsubdomein deactiveer alle plug-ins behalve één hoofdplug-in […]
Gebruik hook: woocommerce_checkout_fields om velden op de afrekenpagina van de woocommerce-winkel te verwijderen. Laat als voorbeeld de volgende code in je site vallen, het huidige wordpress-themabestand functions.php:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | add_filter('woocommerce_checkout_fields', function ($fields) { //unset($fields['billing']['billing_first_name']); //unset($fields['billing']['billing_last_name']); unset($fields['billing']['billing_company']); unset($fields['billing']['billing_address_1']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_country']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_phone']); //unset($fields['order']['order_comments']); //unset($fields['billing']['billing_email']); //unset($fields['account']['account_username']); //unset($fields['account']['account_password']); //unset($fields['account']['account_password-2']); return $fields; }); |
Zie de velden die u kunt uitschakelen: Billing Fields billing_first_name billing_last_name billing_company billing_country billing_address_1 billing_address_2 billing_city billing_state billing_postcode billing_phone billing_email Verzendingsvelden shipping_first_name shipping_last_name shipping_company_adres_van_state_postcode_postcode billing_phone billing_email Verzendadres_verzending_adres_adres_van_verzending_1
druk op CTRL + R CTRL + F5 Ctrl + Shift + R Apple + R of Command + R (Apple) in de Chrome-browser de beste manier is: Open de ontwikkelaarstools: Ctrl + Shift + I Nu, laat het paneel open, klik met de linkermuisknop op de "Update" -knop (naast de adresregel) en laat de knop niet los. Na een paar seconden [...]
Installeer deze plug-in: https://wordpress.org/plugins/autoptimize/ Inschakelen in zijn opties wp-admin / options-general.php? Page = autoptimize 'HTML-code optimaliseren?' Pas de volgende code toe in het bestand functions.php van je huidige wp-thema
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | add_filter('autoptimize_html_after_minify', function($content) { $site_url = 'https://bulk-editor.com/'; $content = str_replace("", ' ', $content); $content = str_replace('', ' ', $content); $content = str_replace(" ", ' ', $content); $content = str_replace(' ', ' ', $content); $content = str_replace($site_url . '/wp-includes/js', '/wp-includes/js', $content); $content = str_replace($site_url . '/wp-content/cache/autoptimize', '/wp-content/cache/autoptimize', $content); $content = str_replace($site_url . '/wp-content/themes/', '/wp-content/themes/', $content); $content = str_replace($site_url . '/wp-content/uploads/', '/wp-content/uploads/', $content); $content = str_replace($site_url . '/wp-content/plugins/', '/wp-content/plugins/', $content); return $content; }, 10, 1); |
Vergeet niet in $ site_url de link naar uw sitelink te wijzigen zonder een schuine streep aan het einde
Installeer de volgende plug-in: https://envato.com/market-plugin/ - deze plug-in helpt klanten updates te ontvangen voor de premium thema's en plug-ins die zijn gekocht via Envato Market (ThemeForest & CodeCanyon). Voer de volgende stappen uit: Installeer de plug-in op uw site Ga naar https://build.envato.com/create-token/?purchase:download=t&purchase:verify=t&purchase:list=t Voer daar de tokennaam in, willekeurige woorden, of een reeks willekeurige symbolen. Onder de ingevoerde token-key selecteert u de gewenste services, […]
Soms is het nodig om een nieuwe gebruiker op de WordPress-site te maken met behulp van PHP-code. Hieronder staat de code die dit zal laten werken