Custom post type permalink shows blog/ in the single page











up vote
1
down vote

favorite












I have created a custom post type and it permalink shows blog/ into the single page,
For eg : www.example.com/blog/event/wine-tasting/



I need this blog/ to be removed from the single page URL and it should come like,
www.example.com/event/wine-tasting/










share|improve this question
























  • What CMS are you using? Or where are you doing this? Are you using .htaccess to rewrite URLs? Need a bit more clarification.
    – Lloan Alas
    Jul 3 '15 at 4:40










  • I am using wordpress CMS and the default custom post permalink generates with blog/ URL. Not using any rewrite rule in functions.php also not redirecting via .htaccess.
    – Nuju Shan
    Jul 3 '15 at 4:45

















up vote
1
down vote

favorite












I have created a custom post type and it permalink shows blog/ into the single page,
For eg : www.example.com/blog/event/wine-tasting/



I need this blog/ to be removed from the single page URL and it should come like,
www.example.com/event/wine-tasting/










share|improve this question
























  • What CMS are you using? Or where are you doing this? Are you using .htaccess to rewrite URLs? Need a bit more clarification.
    – Lloan Alas
    Jul 3 '15 at 4:40










  • I am using wordpress CMS and the default custom post permalink generates with blog/ URL. Not using any rewrite rule in functions.php also not redirecting via .htaccess.
    – Nuju Shan
    Jul 3 '15 at 4:45















up vote
1
down vote

favorite









up vote
1
down vote

favorite











I have created a custom post type and it permalink shows blog/ into the single page,
For eg : www.example.com/blog/event/wine-tasting/



I need this blog/ to be removed from the single page URL and it should come like,
www.example.com/event/wine-tasting/










share|improve this question















I have created a custom post type and it permalink shows blog/ into the single page,
For eg : www.example.com/blog/event/wine-tasting/



I need this blog/ to be removed from the single page URL and it should come like,
www.example.com/event/wine-tasting/







wordpress blogs permalinks






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 11 at 11:14









Lloan Alas

1,207623




1,207623










asked Jul 3 '15 at 4:38









Nuju Shan

62




62












  • What CMS are you using? Or where are you doing this? Are you using .htaccess to rewrite URLs? Need a bit more clarification.
    – Lloan Alas
    Jul 3 '15 at 4:40










  • I am using wordpress CMS and the default custom post permalink generates with blog/ URL. Not using any rewrite rule in functions.php also not redirecting via .htaccess.
    – Nuju Shan
    Jul 3 '15 at 4:45




















  • What CMS are you using? Or where are you doing this? Are you using .htaccess to rewrite URLs? Need a bit more clarification.
    – Lloan Alas
    Jul 3 '15 at 4:40










  • I am using wordpress CMS and the default custom post permalink generates with blog/ URL. Not using any rewrite rule in functions.php also not redirecting via .htaccess.
    – Nuju Shan
    Jul 3 '15 at 4:45


















What CMS are you using? Or where are you doing this? Are you using .htaccess to rewrite URLs? Need a bit more clarification.
– Lloan Alas
Jul 3 '15 at 4:40




What CMS are you using? Or where are you doing this? Are you using .htaccess to rewrite URLs? Need a bit more clarification.
– Lloan Alas
Jul 3 '15 at 4:40












I am using wordpress CMS and the default custom post permalink generates with blog/ URL. Not using any rewrite rule in functions.php also not redirecting via .htaccess.
– Nuju Shan
Jul 3 '15 at 4:45






I am using wordpress CMS and the default custom post permalink generates with blog/ URL. Not using any rewrite rule in functions.php also not redirecting via .htaccess.
– Nuju Shan
Jul 3 '15 at 4:45














1 Answer
1






active

oldest

votes

















up vote
2
down vote













I did some research and came up with this post:




When you register the custom post type, you have to specify that the
rewrite rule shouldn't be prepended with the existing URL structure.



In short, this means that this line in your register_post_type call:



'rewrite' => array('slug' => 'projects'), should turn into this:



'rewrite' => array('slug' => 'projects','with_front' => false), For
more info, check out the rewrite argument from the codex entry on
register_post_type



edit: just make sure that, after updating the code, you flush the
rewrite rules by visiting Settings > Permalinks. Otherwise you'll
still see the old links. - andreiio




Also found these 3 resources that may help you if you get stumped from another question found here - by Sophia:



WordPress.org Topic



TutsPlus



Another Question






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31198573%2fcustom-post-type-permalink-shows-blog-in-the-single-page%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    2
    down vote













    I did some research and came up with this post:




    When you register the custom post type, you have to specify that the
    rewrite rule shouldn't be prepended with the existing URL structure.



    In short, this means that this line in your register_post_type call:



    'rewrite' => array('slug' => 'projects'), should turn into this:



    'rewrite' => array('slug' => 'projects','with_front' => false), For
    more info, check out the rewrite argument from the codex entry on
    register_post_type



    edit: just make sure that, after updating the code, you flush the
    rewrite rules by visiting Settings > Permalinks. Otherwise you'll
    still see the old links. - andreiio




    Also found these 3 resources that may help you if you get stumped from another question found here - by Sophia:



    WordPress.org Topic



    TutsPlus



    Another Question






    share|improve this answer



























      up vote
      2
      down vote













      I did some research and came up with this post:




      When you register the custom post type, you have to specify that the
      rewrite rule shouldn't be prepended with the existing URL structure.



      In short, this means that this line in your register_post_type call:



      'rewrite' => array('slug' => 'projects'), should turn into this:



      'rewrite' => array('slug' => 'projects','with_front' => false), For
      more info, check out the rewrite argument from the codex entry on
      register_post_type



      edit: just make sure that, after updating the code, you flush the
      rewrite rules by visiting Settings > Permalinks. Otherwise you'll
      still see the old links. - andreiio




      Also found these 3 resources that may help you if you get stumped from another question found here - by Sophia:



      WordPress.org Topic



      TutsPlus



      Another Question






      share|improve this answer

























        up vote
        2
        down vote










        up vote
        2
        down vote









        I did some research and came up with this post:




        When you register the custom post type, you have to specify that the
        rewrite rule shouldn't be prepended with the existing URL structure.



        In short, this means that this line in your register_post_type call:



        'rewrite' => array('slug' => 'projects'), should turn into this:



        'rewrite' => array('slug' => 'projects','with_front' => false), For
        more info, check out the rewrite argument from the codex entry on
        register_post_type



        edit: just make sure that, after updating the code, you flush the
        rewrite rules by visiting Settings > Permalinks. Otherwise you'll
        still see the old links. - andreiio




        Also found these 3 resources that may help you if you get stumped from another question found here - by Sophia:



        WordPress.org Topic



        TutsPlus



        Another Question






        share|improve this answer














        I did some research and came up with this post:




        When you register the custom post type, you have to specify that the
        rewrite rule shouldn't be prepended with the existing URL structure.



        In short, this means that this line in your register_post_type call:



        'rewrite' => array('slug' => 'projects'), should turn into this:



        'rewrite' => array('slug' => 'projects','with_front' => false), For
        more info, check out the rewrite argument from the codex entry on
        register_post_type



        edit: just make sure that, after updating the code, you flush the
        rewrite rules by visiting Settings > Permalinks. Otherwise you'll
        still see the old links. - andreiio




        Also found these 3 resources that may help you if you get stumped from another question found here - by Sophia:



        WordPress.org Topic



        TutsPlus



        Another Question







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 23 '17 at 12:32









        Community

        11




        11










        answered Jul 3 '15 at 5:28









        Lloan Alas

        1,207623




        1,207623






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f31198573%2fcustom-post-type-permalink-shows-blog-in-the-single-page%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            List item for chat from Array inside array React Native

            Thiostrepton

            Caerphilly