Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #491474

    Hello,
    I don’t understand why title in single Portfolio-Page will not displayed. In my testinstallation it works, but not here:

    I changed functions.php in my chrildtheme with this:

    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
        if ( is_single() )
        {
            $category = get_the_category($id);
    		$args['title'] = $category[0]->name;
            $args['link'] = get_permalink($id);        
        }
    
        return $args;
    }

    Don’t know, if this is relevant?

    Second Problem:
    I my testinstallation there is text rigtht beside the Picture, in beta there is Picture above text. Can’t find he Option for this. Can someone help?

    thanks
    Claudia

    #492356

    Hi Claudia!

    1 & 2 – Do you mind creating a temporary admin login and posting it here privately so we can look into it?

    Cheers!
    Yigit

    #492374

    Hi Yigit,

    I’ve changed the beta to live-domain an insert API key for registration.

    #492720

    Hi!

    Technically, portfolio items doesn’t have categories, it has terms from the portfolio entries taxonomy. Please replace the code with this:

    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
        if ( is_single() )
        {
            $terms = get_the_terms( $id, 'portfolio_entries' );
    		$args['title'] = $terms[0]->name;
            $args['link'] = get_permalink($id);        
        }
    
        return $args;
    }

    We would like to add the code but the Design > Editor panel is not available when we logged in.

    Cheers!
    Ismael

    #495396

    Hello Ismael,

    thanks for your help! I’ve insert the code and now it looks good for the single-portfolio, but in single-post, the category will not be display. I try to add both codes, but looks like only one version will be display. Do you have an idea to get both. I try to have a look on the single.php and single-portfolio.php, but my knowledge about this code is too poor to change this :-(

    I’ve enabled Editor, so you can check this.

    I want to add two question: I use portfolios to display the teachers of the organisation. And I use normal-post for post and other information. Now I want to change the layout of the single-portfolio.php (http://theaterpaedagogik-ausbildung.at/portfolio-item/friedhelm-roth-lange/) like single-post (http://enfold.ifant.at/friedhelm-roth-lange/) In the second version the picture is on the left side of the text and I have the Title above the text. I try to build this with avia (http://theaterpaedagogik-ausbildung.at/portfolio-item/test/), but t here Ihave to insert titel manually. Is there a way to create a layout for single-portfolio like single_post?

    What is your recommendation to change the layout? I think to change in avia need much more performance as to change in template?

    Cheers!
    Claudia

    #498624

    Hello,
    can someone help?

    Claudia

    #498786

    Hey!

    Add this code below the other one:

    add_filter('avf_title_args', 'avf_title_args_mod', 10, 2);
    function avf_title_args_mod($args,$id)
    {
        if ( is_single() )
        {
            $category = get_the_category($id);
    		$args['title'] = $category[0]->name;
            $args['link'] = get_permalink($id);        
        }
    
        return $args;
    }

    Regards,
    Ismael

    #498943

    Hello Ismael,
    thanks for your answer. But unfortunately that does not work. I tried to change the order of the both codes, but always the first code works and the second don’t. Actually it looks like this:

    add_filter('avf_title_args', 'avf_title_args_mod', 10, 2);
    function avf_title_args_mod($args,$id)
    {
        if ( is_single() )
        {
            $category = get_the_category($id);
    		$args['title'] = $category[0]->name;
            $args['link'] = get_permalink($id);        
        }
    
        return $args;
    }
    
    add_filter('avf_title_args', 'fix_single_post_title', 10, 2);
    function fix_single_post_title($args,$id)
    {
        if ( is_single() )
        {
            $terms = get_the_terms( $id, 'portfolio_entries' );
    		$args['title'] = $terms[0]->name;
            $args['link'] = get_permalink($id);        
        }
    
        return $args;
    }

    Do you have another idea to create this? Thanks!
    The Login details above are stil valid.

    Claudia

    • This reply was modified 9 years, 3 months ago by Claudia.
    #501472

    Hello,
    any solution for the problem?
    Claudia

    #501935

    Hi!

    Sorry for the delay. Remove all modifications then replace it with this:

    add_filter('avf_title_args', 'avf_title_args_mod', 10, 2);
    function avf_title_args_mod($args,$id)
    {
        if ( is_singular('post') ) {
            $category = get_the_category($id);
    		$args['title'] = $category[0]->name;
            $args['link'] = get_permalink($id);        
        } 
    	else if ( is_singular('portfolio') ) {
    		$terms = get_the_terms( $id, 'portfolio_entries' );
    		$args['title'] = $terms[0]->name;
            $args['link'] = get_permalink($id); 
    	}
    
        return $args;
    }

    Best regards,
    Ismael

    #502028

    Hello Ismael,
    now it works on both single pages. Thanks very much for your application!

    Claudia

    #502495

    Hi!

    You’re welcome. Let us know should you have any questions. :)

    Cheers!
    Ismael

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Title in Single-Portfolio-Page and position of picture’ is closed to new replies.