• Resolved johno69

    (@johno69)


    When we use the album shortcode, and a user clicks into an album, it goes to the photo’s page fine.

    Example:

    website.com/albums – Albums page with album shortcode
    website.com/photos – Photos page with photos shortcode

    But then the permalink/breadcrumb for the current page is essentially a link to:

    website.com/photos

    This shows as blank when accessed directly.

    I manually added a link to the albums page saying “Back to albums” but it’s a bit annoying knowing I have an invalid link in the breadcrumbs.

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

    (@johno69)

    I fixed this with this function:

    //advanced title + breadcrumb function
    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
            $args['title'] = get_the_title($id);
            $args['link'] = "";
            $args['heading'] = 'h1';
    
        return $args;
    }
    
    add_filter( 'post-format-standard', 'avia_category_content_filter', 15, 1);
    function avia_category_content_filter($current_post)
    {
    if(!is_single())
    {
    	$current_post['content'] =  get_the_excerpt();
    	$current_post['content'] .= '<div class="read-more-link"><a href="'.get_permalink().'" class="more-link">'.__('Read more','avia_framework').'<span class="more-link-arrow">  &rarr;</span></a></div>';
    }
    return $current_post;
    }

    I see no point the page title being a link to the current page anyway. Then just added a button, “<- Back to albums” on my photos page.

Viewing 1 replies (of 1 total)
  • The topic ‘Permalink to Photo’s page breaks it’ is closed to new replies.