I had a test wp instance where I imported data and then installed plugins, among which, wps hide login.
Then I moved everything to a new host, also changing the home and site urls. Now I can login to my new slug but I’m not able to logout, it takes me back to “wp-admin” (dashboard).
I tried uninstalling/reinstalling the plugin but still won’t work. On the new host I have nginx; I tried looking at wp debug logs and also nginx’s access/error.log but I couldn’t find anything relevant.
Do you mind helping me trouble shoot this? Thanks
]]>Now i’m no coder but i asked ChatGPT and it tweaked the plugin and it works.
<?php
/**
* Admin Slug Column (Streamlined Version)
*
* @package Admin_Slug_Column_Simplified
* @wordpress-plugin
* Plugin Name: Admin Slug Column (Streamlined)
* Description: Adds a sortable "Slug" column to the admin posts/pages list without additional columns.
* Version: 1.0
* Author: Adapted Plugin
*/
// If this file is called directly, abort
if ( ! defined( 'WPINC' ) ) {
die;
}
// Only run plugin in the admin
if ( ! is_admin() ) {
return;
}
// Add slug column to admin posts/pages lists
function add_slug_column($columns) {
$columns['slug'] = __('Slug');
return $columns;
}
add_filter('manage_posts_columns', 'add_slug_column');
add_filter('manage_pages_columns', 'add_slug_column');
// Populate slug column with the post slug
function display_slug_column_content($column, $post_id) {
if ($column === 'slug') {
$post = get_post($post_id);
echo esc_html($post->post_name); // Display the post slug
}
}
add_action('manage_posts_custom_column', 'display_slug_column_content', 10, 2);
add_action('manage_pages_custom_column', 'display_slug_column_content', 10, 2);
// Make slug column sortable
function add_slug_column_sortable($columns) {
$columns['slug'] = 'slug';
return $columns;
}
add_filter('manage_edit-post_sortable_columns', 'add_slug_column_sortable');
add_filter('manage_edit-page_sortable_columns', 'add_slug_column_sortable');
// Modify the query to sort by slug when requested
function sort_by_slug_column($query) {
if (!is_admin() || !$query->is_main_query()) {
return;
}
$orderby = $query->get('orderby');
if ('slug' == $orderby) {
$query->set('orderby', 'name'); // 'name' represents the slug in the database
}
}
add_action('pre_get_posts', 'sort_by_slug_column');
]]>I’d like my blog links to be domain/blog/postname. But when I set the permalinks to this custom structure, the brand links become domain/blog/brand/brandname.
Is it possible to remove the “blog” from just the brand links?
Thanks,
Debbie
I am using a theme which utilizes different post types such as regular “posts”, “videos” and “tv series”. I can add a post at “posts” tab, I can add a video(this is a kind of post) at “videos” tab, and the same goes for “tv series” tab too.
I am experiencing an annoying url problem. My permalinks are custom structured: /%category%/%postname%/
This works perfectly fine when I post a normal post via “posts” tab. However, when I post a custom post type (in videos or tv series tab) the url goes something like: mydomain..com/title/example-movie-name and when I post an episode, the url goes: mydomain..com/episodes-title/example-series-episode-3/. /title/ is always there for “video” posts, and /episodes-title/ is alawys there for “tv series” posts. They are so irritating.
I tried using custom code via code snippet plugin, thanks to chatgpt, to remove those unnecessary slugs (/title/ and /episodes-title/) from the url. It actually worked but it also broke all the links and the whole website so I had to undo it. I also tried inserting that code in functions.php but the results were the same. Also, my mod_rewrite is on.
There are more than 2000 “tv series posts(episodes)” and 100 “video posts”, so even if there is a way to do this with a plugin, manually one by one, I guess I couldn’t do it as it’d take soo long. I need to remove those unnecessary slugs in a shorter way.
At this point, I am not even sure if I really need to remove that slug. I just think it is unnecessary and in terms of seo, it’s better if I remove it. The cleaner the url is, the better experience for the user, right? I am not sure even if I manage to edit the urls, would it create indexing problems?
Here is the custom code chatgpt gave me: (video_skrn and episodes_skrn are the names for my custom post types)
function custom_post_type_slug($args, $post_type) {
if ($post_type === ‘video_skrn’) { // Replace ‘videos’ with your post type slug
$args[‘rewrite’] = array(‘slug’ => ‘/’); // Blank slug removes it completely
}
if ($post_type === ‘episodes_skrn’) { // Replace with your post type slug
$args[‘rewrite’] = array(‘slug’ => ‘/’);
}
return $args;
}
add_filter(‘register_post_type_args’, ‘custom_post_type_slug’, 10, 2);
I appreciate any help, thanks!
]]>Hello,
I was wondering if there was a way to change the URL of the feed, for example instead of https://www.mysite.com/feed/podcast/ , it would be https://www.mysite.com/feed/podcastv2.
I see there is an option to “Redirect your feed to a new URL” but as I saw in other posts here, this would need me to manually generate/manage the other feed (which is not what i am looking for).
So maybe is there a way to change the “podcast” slug somewhere in the plugin files so the new url automatically gets “podcastv2” in it?
Thank you for your help
]]>For example: I have domain.com/contact and domain.com/en/contact-2 for the translated page in English. My idea is that the /en/ makes the URL different so why does it add the -2 at the end or am I missing something?
]]>On regular pages, there is a /slug/#scrolltoelement – and it works perfectly.
But on the home page which in my case is https://havfuglen.no – when I click on the scroll element it echoes: https://havfuglen.no/#scrolltoelement – and nothing happens.
I found another topic here where a person described the same problem:
https://www.ads-software.com/support/topic/problem-to-scroll-menu/
Your response was:
Try this:
1.Go to plugin settings and click the “Reset to default” button at the bottom.
2.Enable “Prevent other scripts from handling plugin’s links” option and add the following value to “Prevent other scripts from handling plugin’s links selector(s)” option field:
a[href*='#']:not([href='#'])
Click “Save Changes”.
3.Edit your site’s
wp-config.php
file (e.g. via FTP. It is in the site’s root directory) and add the following code anywhere above the “/* That’s all, stop editing! Happy publishing. */” code:
define('PS2ID_MINIFIED_JS', false);
Save the file and let me know so I can test it again.
I did all of these steps and it is still not working.
How to work around this?
But for the link to a course bundle, we now have, for example:
/training/course-bundle/coachtraining-rotterdam/
Is there a way to change this slug as well? I don’t see this option in the settings.