Page permalinks are http but show up as https?

Try this in your wp-config.php define(‘WP_HOME’,’http://example.com’); define(‘WP_SITEURL’,’http://example.com’); This basically hard-codes the WordPress options for siteurl and home, which will means WordPress will redirect all requests to those URLs. This won’t change any permalinks in any content that you have in your site — to do this I’d recommend using a plugin like WP Migrate DB … Read more

WordPress loop put title into variable

Creating variables on the fly like that is not needed. Just use an array instead. $myvars = []; inside your foreach loop you can: $myvars[] = array(‘title’=>$t,’image’=>$v); After your loop you can: //First title, First image echo $myvars[0][‘title’]; echo $myvars[0][‘image’]; //Second title, Second image echo $myvars[1][‘title’]; echo $myvars[1][‘image’]; This way you can always print_r($myvars) and … Read more

Permalinks setting

It’s possible to have them share the same slug, but you need to manually resolve conflicts yourself. You have to check if the end of the requested URL is an existing term, and reset the query vars accordingly if it’s not found: function wpd_post_request_filter( $request ){ if( array_key_exists( ‘category_name’ , $request ) && ! get_term_by( … Read more

Support Gallery link to pages

What about using Page Links To? Install this plugin, go to the edit screen of the post “Project Management” and then link that post to any page you want. That way you can redirect the post to any page you want. Not a perfect solution but may work for your setup.

Accessing WordPress Functions get_permalink() in Vanilla PHP?

The developer’s reference is a great place to start. You’ll find get_permalink in wp-includes/link-template.php. You might want to look into wp-cli wp post list –post__in=1 –field=url should do the trick as discussed in wp-cli issue#2727 Also, there’s the rest-api to consider. The best solution for getting the permalink might be to just post/cURL a request … Read more

Remove /category/ from category (archive) page URLs (without using a plugin)

Please add this code in functions.php to remove the “category” text from permalink. function remove_category( $string, $type ) { if ( $type != ‘single’ && $type == ‘category’ && ( strpos( $string, ‘category’ ) !== false ) ){ $url_without_category = str_replace( “/category/”, “/”, $string ); return trailingslashit( $url_without_category ); } return $string; } add_filter( ‘user_trailingslashit’, … Read more

htaccess strip url

Apologies that this doesn’t directly answer your question but If I were you I would use the following structure: /%post_id%/%location%/%course%/%postname% Using the id should help to speed up the page load as it reduces the amount of processing that WP needs to do to select the correct page and you still get a nice enough … Read more