• govisola

    (@govisola)


    Hello,

    I have a website that includes normal pages, blog posts, and a store. I want to change the permalink structure only to the blog posts. The blog post has to be mywebsite.com/isola-di-govinda/%postname%. How to do it with no plugin?

    For the other pages, the structure has to be mywebsite.com/%postname%/ (it can be changed inside the dashboard, I know). For normal page is currently mywebsite.com/%category%/%postname%/

    I am looking forward to hearing from you.

    Best regards

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Hi

    As far as I know, pages are not affected by the structure you put in place via the dashboard, only posts.

    So if you have a Custom Structure /isola-di-govinda/%postname% that should only apply to posts and NOT pages as they will just be be mywebsite.com/page-title-or-slug

    Thread Starter govisola

    (@govisola)

    Hi @judgerookie

    ok but because I want to use a plugin for other stuff, the plugin I want to download requires that I have in the custom structure this “mywebsite.com/%postname%/”. So, the question is: How to change the permalink structure only for blog posts without changing the permalink settings via the dashboard?

    I want for only for my blog posts this structure: mywebsite.com/isola-di-govinda/%postname%

    and on the same time I want that the permalink structure via dashboard is: mywebsite.com/%postname%/

    Hi

    What is the plugin that needs this deviation? AND Is there a particular reason the plugin needs to deviate from the standard practice?

    Unless I’m mistaken, at the moment it appears the plugin wants WordPress to work around to its needs rather than the plugin being built to the WordPress environment but the responses may throw some light and any options on any possible workarounds

    Thread Starter govisola

    (@govisola)

    thank you @judgerookie

    the plug-in is the one for printfull…

    What do you suggest me to do?

    Best regards

    Thread Starter govisola

    (@govisola)

    and more, for printfull plug-in is mandatory that your permalink structure is only mywebsite.com/post-name. But also yoast seo suggests you to have that structure. For yoast it is not mandatory.

    Hi

    Is it this one? https://www.ads-software.com/plugins/printful-shipping-for-woocommerce/

    If it is, I can check it out in one of my TEST sites and see what it does andthat may throw some light on any workaround

    If it isn’t, please send a link

    Thread Starter govisola

    (@govisola)

    Hello @judgerookie

    yes it is this one. Oh, that would be very nice from you. I appreciate it a lot.

    I am looking forward to learning more about your test.

    Best regards

    Hi

    This is my TEST area https://test.kholwadia.co.uk/wordpress/, let me know if you want me to set you up as a User in there. It’ll probably be tomorrow (Sunday) when I can have a look. If you find the answer before that, let me know.

    Moderator Support Moderator

    (@moderator)

    @judgerookie

     Please don’t offer to send or post logon credentials on these forums: https://www.ads-software.com/support/guidelines#the-bad-stuff

    It is not OK to offer, enter, or send site credentials on these forums. Thanks for your cooperation.

    Thread Starter govisola

    (@govisola)

    @judgerookie, since logging in to your site is not allowed, if you want to help me, you should do it without my help. I am also not useful… I don’t know why we should test it… in one of your last messages, you said one interesting thing too: “it appears the plugin wants WordPress to work around to its needs rather than the plugin being built to the WordPress environment”…. It doesn’t seem good and professional to use this plugin.

    Hi @moderator

    Sorry for the breach, didn’t realise it included networks for testing BUT I’ll adhere to the rules, else, it would be chaos.

    Hi @govisola

    Under the circumstances, probably best to post the thread or close this thread and post on the plugin forum: https://www.ads-software.com/support/plugin/printful-shipping-for-woocommerce/ assuming the plugin developer will resolve or guide in no time

    Thread Starter govisola

    (@govisola)

    thank you @judgerookie ??

    To change the permalink structure for blog posts only, without using a plugin, you can achieve this by adding some custom code to your theme’s functions.php file.

    Thread Starter govisola

    (@govisola)

    thank you @elfrieda

    do you know what code or some tutorial online I can use?

    you can try this code but be careful little mistake can break your site. i am experienced developer and implemented on this site [removed by moderator]

    function custom_blog_post_permalink($permalink, $post) {
    // Check if the post type is ‘post’
    if ($post->post_type == ‘post’) {
    // Build the new permalink structure
    $new_permalink = home_url(‘/isola-di-govinda/’ . $post->post_name . ‘/’);
    return $new_permalink;
    }
    // Return the default permalink for other post types
    return $permalink;
    }
    add_filter(‘post_link’, ‘custom_blog_post_permalink’, 10, 2);

    function add_custom_rewrite_rules() {
    add_rewrite_rule(‘^isola-di-govinda/([^/]+)/?’, ‘index.php?name=$matches[1]’, ‘top’);
    }
    add_action(‘init’, ‘add_custom_rewrite_rules’);

Viewing 15 replies - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.