WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 404 When Editing Posts (2 posts)

  1. mrtoner
    Member
    Posted 3 years ago #

    I'm using Yinjie Soon's DF-Style Linked List plugin. Rather than modifying the theme I'm using, I'm using separate code to change the behavior of the links on my post titles:

    add_filter('post_link','df_fix_permalink');
    
    function df_fix_permalink () {
      if (get_the_linked_list_link() == '') {
        return get_permalink();
      }
      else {
        return get_the_linked_list_link();
      }
    }

    This works fine: for posts with a linked_list_url it changes the post title link to that URL. However, attempts to edit the post now end up in a 404. To edit a post, I must comment out add_filter().

    Any suggestions to fix this?

  2. mrtoner
    Member
    Posted 3 years ago #

    Based on an example here I was able to solve the problem:

    add_filter('post_link','df_fix_permalink');
    
    function df_fix_permalink ($permalink) {
      if (get_the_linked_list_link() == '') {
        return $permalink;
      }
      return get_the_linked_list_link();
    }

Topic Closed

This topic has been closed to new replies.

About this Topic