-
AuthorPosts
-
August 21, 2015 at 4:19 pm #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
ClaudiaAugust 24, 2015 at 4:44 pm #492356Hi Claudia!
1 & 2 – Do you mind creating a temporary admin login and posting it here privately so we can look into it?
Cheers!
YigitAugust 24, 2015 at 5:03 pm #492374Hi Yigit,
I’ve changed the beta to live-domain an insert API key for registration.
August 25, 2015 at 9:49 am #492720Hi!
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!
IsmaelAugust 30, 2015 at 12:03 am #495396Hello 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!
ClaudiaSeptember 4, 2015 at 10:22 pm #498624Hello,
can someone help?Claudia
September 6, 2015 at 3:48 am #498786Hey!
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,
IsmaelSeptember 6, 2015 at 9:42 pm #498943Hello 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, 2 months ago by Claudia.
September 11, 2015 at 8:35 am #501472Hello,
any solution for the problem?
ClaudiaSeptember 12, 2015 at 4:09 am #501935Hi!
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,
IsmaelSeptember 12, 2015 at 9:48 am #502028Hello Ismael,
now it works on both single pages. Thanks very much for your application!Claudia
September 14, 2015 at 7:06 am #502495 -
AuthorPosts
- The topic ‘Title in Single-Portfolio-Page and position of picture’ is closed to new replies.