• Resolved miketemby

    (@miketemby)


    Hello,
    I have setup my category slug as event-category but all my event category permalinks include /blog/event-category/..

    My WP posts permalink structure is /blog/%postname%/ but why is this base being used for event categories and how can I fix it?

Viewing 1 replies (of 1 total)
  • Thread Starter miketemby

    (@miketemby)

    Nevermind, I fixed it myself with some code.. this really shouldn’t be required!

    /**
     * Filter the Modern Events Calendar - Category Taxoonomy to register more options.
     *
     * @param $args       array    The original tax args.
     * @param $tax  string   Taxonomy key.
     *
     * @return array
     */
    function custom_mec_event_cat_permalink( $args, $tax ) {
        // If not a MEC Events Cat, bail.
        if ( 'mec_category' !== $tax ) {
          return $args;
        }
        // Add additional Taxonmy args.
        $tax_args = array(
          'rewrite' => array(
              'with_front' => false,
          )
        );
        // Merge args together.
        return array_merge_recursive( $args, $tax_args );
      }
      add_filter( 'register_taxonomy_args', 'custom_mec_event_cat_permalink', 10, 2 );

    I see the same issue was addressed on Event archive pages nearly two years ago.. https://www.ads-software.com/support/topic/fixing-events-permalink/

    • This reply was modified 3 years, 3 months ago by miketemby.
    • This reply was modified 3 years, 3 months ago by miketemby.
    • This reply was modified 3 years, 3 months ago by miketemby.
    • This reply was modified 3 years, 3 months ago by miketemby.
Viewing 1 replies (of 1 total)
  • The topic ‘Category Permalink Is Using /Blog/ base’ is closed to new replies.