[Resolved] Rewrite URL fragment/anchor

Home Forums Support [Resolved] Rewrite URL fragment/anchor

Home Forums Support Rewrite URL fragment/anchor

  • This topic has 19 replies, 3 voices, and was last updated 4 years ago by David.
Viewing 15 posts - 1 through 15 (of 20 total)
  • Author
    Posts
  • #992608
    Anonymous

    The theme generates URI with URL fragments or anchors e.g. http://www.domain.com/post-name/#post-id. There doesn’t appear to limit this to only http://www.domain.com/post-name. What options are there to remove the #post-id URL fragment?

    #992642
    Leo
    Staff
    Customer Support

    Hi there,

    This should help:
    https://docs.generatepress.com/article/generate_more_jump/

    Let me know ๐Ÿ™‚

    #992670
    Anonymous

    Thanks Leo. Which file does it need to be added to?

    #992748
    David
    Staff
    Customer Support

    Hi there,

    that PHP snippet should go in your child themes function.php

    #993154
    Anonymous

    Thanks David. Can you please confirm the path of the child theme?

    #993175
    Leo
    Staff
    Customer Support

    Not quite sure if I understand.

    When you download and install a child theme from here:
    https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme

    You get a folder named generatepress_child with 3 tiles in it:
    https://www.screencast.com/t/FONtnocsr9

    #993385
    Anonymous

    Thanks Leo.

    The theme was installed via GenerePress’ site library option. There isn’t a directory called “generate_child”.

    Is the directory path for example /home/user/public_html/wp-content?

    #993426
    Leo
    Staff
    Customer Support

    The site library templates aren’t child themes.

    You will need to add one using the instruction here first:
    https://docs.generatepress.com/article/using-child-theme/#installing-a-child-theme

    Or just use the Code Snippets option here:
    https://docs.generatepress.com/article/adding-php/

    #993437
    Anonymous

    Thanks Leo. Why is there a need to install a child theme?

    Can the removal of the URL fragment be achieved without it and the use of a plugin?

    #993438
    Leo
    Staff
    Customer Support

    You have to choose either a child theme or a plugin to add PHP.

    #993440
    Anonymous

    Thanks Leo. Will uploading the child theme overwrite any of the pages, posts and/or settings?

    #993441
    Leo
    Staff
    Customer Support

    No ๐Ÿ™‚

    #1238068
    Anonymous

    Hi Leo,

    The filter add_filter( ‘generate_more_jump’, ‘__return_false’ ); was added to the wp-content/themes/generatepress_child/functions.php file. It does not however remove the URL fragment or anchor from the read me button.

    The child theme was uploaded following the instructions at https://docs.generatepress.com/article/using-child-theme/. I assume that the child team does not need to be activated.

    #1238298
    David
    Staff
    Customer Support

    Hi there,

    the Child Theme has to be activated.

    #1238302
    Anonymous

    Thanks David. The documentation did not include the requirement to activate it.

    It works now although it has distorted the “Split” navigation menu. How can it be reinstated?

    There was no custom CSS other than the “Additional CSS” which has now been lost.

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