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

How to get post image root URL?

The get_attached_file() function returns the path to a file based on the attachment ID: $FeaturedImage = get_attached_file( get_post_thumbnail_id() ); Getting the path to a specific size is more complicated. WordPress stores the filename for resized versions of the images in as attachment metadata, that can be retrieved with wp_get_attachment_metadata(). Once you have the filename of … 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

Custom Post Type “MUST NOT” be able to search via URL

Welcome! After creating a post type using pods, You can navigate to Advanced options and uncheck Public and Publicly Queryable. Note: There are parameters like exclude_from_search, publicly_queryable, show_ui, and show_in_nav_menus that are inheriting value from public. You need to set them manually if you want to use them. More info: https://developer.wordpress.org/reference/functions/register_post_type/

Cannon see subcategory in permalink

Good question. WordPress determines the permalink by finding the category closest to the root. If the parent category is selected (or if both the parent category and the child category are selected), then the permalink will only include the parent category. If only the child category is selected, then the permalink will include the parent … Read more

Route subpage to Custom Post Type

I usually struggle with this, however this time I managed it relatively easy. Main reference for this answer is here: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule I’d like to use anything in the below as discipline. /artists/djave_co/anything First of all, I added a “rewrite tag” function custom_rewrite_tag() { add_rewrite_tag(‘%discipline%’, ‘([^&]+)’); } add_action(‘init’, ‘custom_rewrite_tag’, 10, 0); Next, I did print_r($wp_query->query_vars) on … Read more