Using arbitrary paths in page urls
Using arbitrary paths in page urls
Using arbitrary paths in page urls
WordPress doesn’t use sessions. User authentication is done with cookies. But, there are many plugins that use sessions for some purpose, and it is possible that you are using one (or even more) plugin that is using sessions. You should try to determine which plugin does that and start from there. Search for the session_start() … Read more
Images are searched in the wrong path
Yes you can do this with a custom rewrite. I am doing the same for a custom post type, in my case profile. So my URL = domain.com/profile/some-custom-slug. Dynamically I create /meet-me behind it, so it becomes domain.com/profile/some-custom-slug/meet-me. The real address of the contact page is domain.com/profile/some-custom-slug/?meet=true (or something else unique). function wpse343933_todo() { add_rewrite_rule( … Read more
Retrieving a path when dealing with composer packages
Those links are called Attachment pages, and WordPress creates one for each media attachment in a post. There are a few plugins to disable them. To redirect the user to the actual post, one can add the following line of code: // in wp-content/themes/[your-child-theme]/image.php <?php wp_redirect(get_permalink($post->post_parent)) ; ?> Link: https://www.greengeeks.ca/tutorials/article/set-wordpress-to-disable-attachment-pages-for-media/
If I understand you, don’t use ‘localhost’. That only works if you are testing from the same machine that is running the server. (A virtualized machine counts as a different machine.) Give your server (the machine running the server) a static IP address– something like 192.168.1.5– and use that instead of ‘localhost’. That will work … Read more
Call get_stylesheet_directory_uri() for the current theme, or get_template_directory_uri() for the parent theme of a child theme, and append your file paths to that. $url = get_stylesheet_directory_uri() . ‘/images/my-icon.png’; $url = get_template_directory_uri() . ‘/images/my-icon.png’; Edit: To determine whether you’re in a plugin, a parent theme or a child theme, compare the folder you’re in (via dirname(__FILE__)) … Read more
//get current page’s path $pagePath = parse_url( $_SERVER[‘REQUEST_URI’] ); $pagePath = $pagePath[‘path’]; $pagePath = substr($pagePath, 1, -1);//remove slashes
So I’m taking some liberties with this, I’m assuming a couple things: You know the taxonomy the term belongs to You have the term archive link So if I have the term archive link: $url=”http://www.example.com/taxonomy/term/”; I know that the last part of that url is going to be the terms slug. I can use the … Read more