http: not showing in wordpress permalink setting

Go into the wp-options table. Change the URL of your site in two places to https://www.example.com . Or go into the Admin, Settings, General, and fix the URL there. (The setting on that screen reads the value from the wp-options table.) Make sure there are no URL settings in the wp-config.php file. Any setting in … Read more

Adding URL prefix for foreign language support

Are you sure you have correct regex? Also you shouldn’t use flush_rewrite_rules() on init hook. Better to just go and re-save permalinks options in admin, so you won’t flush rules every time. Try to change regex to all chars, otherwise it looks good. add_rewrite_rule (‘^([^/]*)/?’, ‘index.php?lang=$matches[1]’, ‘top’); UPDATE: and then you need to add parameter … Read more

Show category name in the post URL only for specific categories

The easiest way would be to create a custom post type with an archive. <?php register_post_type(‘resource’, array( // Enable Core Categories and Tags ‘taxonomies’ => array(‘category’, ‘post_tag’), // Enable in REST API so it works with the Block Editor ‘show_in_rest’ => true, ‘label’ => ‘Resources’, ‘public’ => true, ‘supports’ => array(‘title’, ‘editor’, ‘excerpt’, ‘thumbnail’, ‘revisions’), … Read more

Permalinks on Windows IIS not working and web.config breaks site – does wordpress not support windows server now, if so how?

Download IIS Rewrite from https://www.iis.net/downloads/microsoft/url-rewrite. Install and restart IIS Then modify the web.config Edit web.config, add the rewrite code. <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <defaultDocument> <files> <add value=”index.php” /> </files> </defaultDocument> <rewrite> <rules> <rule name=”Main Rule” stopProcessing=”true”> <match url=”.*” /> <conditions logicalGrouping=”MatchAll”> <add input=”{REQUEST_FILENAME}” matchType=”IsFile” negate=”true” /> <add input=”{REQUEST_FILENAME}” matchType=”IsDirectory” negate=”true” /> </conditions> <action type=”Rewrite” … Read more

how to get a list of all top level pages

$query_args = array( ‘post_type’ => ‘page’, ‘post_status’ => ‘publish’, ‘parent’ => 0, ); $pages = get_pages( $query_args ); Function get_pages() accepts parameter with parent. Keeping it 0 (zero) will give us first level pages. In the example $pages will contain the first level pages. Use loop for $pages and you can use it in option … Read more

Why can’t change the permalink of my page/post?

When you are in the page you want to update, you can modify the slug at the top above the editor: By default WordPress uses the Page title, but you can change the ‘slug’ to whatever you want. You can also look at Settings > Permalinks for some more options.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)