-
AuthorPosts
-
March 29, 2017 at 11:20 am #768750
Hi there,
Thanks for that nice Enfold template.
I’ve created a new Post-type, using the Portfolio template with Ajax. I’d like to add some information in the preview section (attachments from the plugin “Attachments”).
I’ve found that I have to modify the enfold/config-templatebuilder/avia-shortcodes/portfolio.php file…1. Can I override that file in my enfold-child folder? If yes, how ?
2. Now, when I do some modification to the portfolio.php file, nothing changes in front (I have even deleted that file, nothing happened)
3. When I put some content (the_content) in my first item, it is shown in the preview of all the items. If I put some content in others items, it is not shown.
Thanks for your help (quite urgent project)
March 31, 2017 at 8:13 am #769767Hello, please can I have some help? It is quite urgent, thanks!
March 31, 2017 at 2:51 pm #769975Hi Wazzabi,
Please refer to this thread for a possible solution.
If you need further assistance please let us know.
Best regards,
VictoriaMarch 31, 2017 at 5:55 pm #770102Thank you Victoria, it helped me a lot.
I’ve been able to duplicate and modify portfolio.php in my child theme, and add my attachments in the Ajax preview, but…I’m not able to change parameters in the file “calling the portfolio”, ie that part of the code:
“$grid = new avia_post_grid(array( ‘linking’ => ‘ajax’,
‘columns’ => ‘3’,
‘contents’ => ‘title’,
‘sort’ => ‘no’,
‘paginate’ => ‘yes’,
‘items’ => ’12’,
‘query_orderby’ => ‘title’,
‘query_order’ => ‘DESC’,
‘set_breadcrumb’ => false,
‘preview_mode’ => ‘auto’,
));
$grid->use_global_query();
echo $grid->html();”I’d like a link (on the picture) to the article instead of a lightbox…
Can you help?
Regards,April 1, 2017 at 5:45 pm #770379Hi Wazzabi,
Could you give me a link to the page where this portfolio is rendered and what did you put in your child theme portfolio.php. Could you use https://pastebin.com/ to show me the code?
Best regards,
VictoriaApril 3, 2017 at 11:34 am #771029Thanks Victoria.
I can’t give you a link to the page now because we are on private developpment host.
Here is the code of portfolio.php:
https://pastebin.com/kJFMkZXHHere is the file calling the portfolio:
https://pastebin.com/JXUS9AhrI have a lightbox link on the picture in the ajax preview, but I need a link to the page… I don’t know what option I have to change to get that…?
Regards,
April 5, 2017 at 7:27 pm #772776Hi,
the pastes are set to private, so we can’t see them. However, it will be difficult for us to help you, when we can’t see and inspect the elements in question.
Best regards,
AndyApril 7, 2017 at 7:25 am #773726Now they are public.
I just need to know how I can change the options of the portfolio, especially how I can change the link on the picture (a link to the page instead of a lighbox)….?
ThanksApril 8, 2017 at 11:40 am #774456Hi Wazzabi,
The code that you could change to specify links starts at line 415 in this pastebin https://pastebin.com/kJFMkZXH, but it might be more complex than you think. Depending on how much programming you know. You might want to consider hiring a developer to do it for you.
If you need further assistance please let us know.
Best regards,
VictoriaApril 9, 2017 at 9:38 am #774836Thanks for your reply Victoria.
I’m a developper.
Can you tell me what to change on the line 415?Or, how and where can I switch to that default case?
Regards,April 11, 2017 at 6:04 pm #776221Hi Wazzabi,
If lightbox is not activated, you get the link to the portfolio item page by default. What do you need to change?
Best regards,
VictoriaApril 11, 2017 at 6:15 pm #776230How can I deactivate lightbox?
That’s my question
ThanksApril 13, 2017 at 9:13 pm #777535Hi Wazzabi,
Really depends on where you want to do it. Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaApril 19, 2017 at 8:15 am #779837Hello,
Can I force the sidebar to the left position?
I found that code in my archive page…
//get the sidebar
$avia_config[‘currently_viewing’] = ‘portfolio’;
get_sidebar();Thanks
April 20, 2017 at 11:09 am #780448Hi Wazzabi,
Sidebar can be set to left position in theme options.
If you need further assistance please let us know.
Best regards,
VictoriaApril 20, 2017 at 12:51 pm #780503Thanks I know that. But I want it to the left for my cutsom post and to the right for the blog. They are both Archive pages so I need to “force” one of them in the code… ?
Regards,April 25, 2017 at 6:08 am #782651Hi,
Which pages are you trying to modify? Please send us a link to those pages. You can Use the “avia_layout_filter” filter to change the layout of a certain page. Example:
/** * Change sidebar layout to left or right sidebar */ add_filter('avia_layout_filter', 'avia_change_post_layout', 10, 2); function avia_change_post_layout($layout, $post_id){ if(is_category('css')) { $layout['current'] = $layout["sidebar_right"]; $layout['current']['main'] = "sidebar_right"; } return $layout; }
Best regards,
IsmaelMay 16, 2017 at 6:42 pm #794270Hi,
I’m not able to change parameters (“query_order by”, “items” are not working) in the file “calling the portfolio”, ie that part of the code:
“$grid = new avia_post_grid(array( ‘linking’ => ‘ajax’,
‘columns’ => ‘3’,
‘contents’ => ‘title’,
‘sort’ => ‘no’,
‘paginate’ => ‘yes’,
‘items’ => ’12’,
‘query_orderby’ => ‘title’,
‘query_order’ => ‘DESC’,
‘set_breadcrumb’ => false,
‘preview_mode’ => ‘auto’,
));
$grid->use_global_query();
echo $grid->html();”Can you help?
ThanksMay 16, 2017 at 6:58 pm #794286Hi Ismael,
Some more info (link below) about my custom_type page:
– I’d like to order items by name
– I’d like 12 items per page
– I’d like siderbar on the leftI have that code in my archive page (but it’s not working):
“$grid = new avia_post_grid(array( ‘linking’ => ‘ajax’,
‘columns’ => ‘3’,
‘contents’ => ‘title’,
‘sort’ => ‘no’,
‘paginate’ => ‘yes’,
‘items’ => ’12’,
‘query_orderby’ => ‘title’,
‘query_order’ => ‘DESC’,
‘set_breadcrumb’ => false,
‘preview_mode’ => ‘auto’,
));
$grid->use_global_query();
echo $grid->html();//get the sidebar
$avia_config[‘currently_viewing’] = ‘portfolio’;
get_sidebar()”It is quite urgent now… Can you help?
Thanks a lot
May 18, 2017 at 8:12 am #795532Hi,
It should be “orderby” and “order” parameter but you can’t modify the query by adding it as the avia_post_grid parameter. Please use this filter in the functions.php file instead.
// portfolio query add_filter( 'avia_post_grid_query', 'avia_post_grid_query_mod', 10, 2); function avia_post_grid_query_mod( $query, $params ) { $query['orderby'] = 'title'; $query['order'] = 'DESC'; return $query; }
Best regards,
IsmaelMay 18, 2017 at 12:26 pm #795834Ismael,
1- I’ve pasted the code in the enfold-child functions.php but it makes no change! I don’t understand:
“add_filter( ‘avia_post_grid_query’, ‘avia_post_grid_query_mod’, 10, 2);
function avia_post_grid_query_mod( $query, $params ) {
$query[‘orderby’] = ‘title’;
$query[‘order’] = ‘DESC’;
$query[‘items’] = ’12’;
return $query;
}”2- An issue with the code to get the sidebar on the left. I have a blank page after my header:
“add_filter(‘avia_layout_filter’, ‘avia_change_post_layout’, 10, 2);
function avia_change_post_layout($layout, $post_id){
if(is_post_type(‘tableaux_reglages’))
{
$layout[‘current’] = $layout[“sidebar_left”];
$layout[‘current’][‘main’] = “sidebar_left”;
}
return $layout;
}”Help!!
ThanksMay 22, 2017 at 4:58 am #797366Hi,
Please post the WP and FTP login details so that we can test the filters thoroughly.
Best regards,
IsmaelMay 22, 2017 at 4:19 pm #797748Ismael,
I’m sorry it’s on a private server, I can’t give access. I’ve already put my files in Pastebin:
Here is the code of portfolio.php:
https://pastebin.com/kJFMkZXHHere is the file calling the portfolio:
https://pastebin.com/JXUS9AhrHelp!
ThanksMay 23, 2017 at 6:25 am #798069Hi,
Please remove the filter and the custom modification in the taxonomy-portfolio_entries.php file then use the following hook instead.
add_action( 'pre_get_posts', 'ava_pre_get_posts'); function ava_pre_get_posts($query){ if(is_archive() && is_tax('portfolio_entries')): $query->set( 'order', 'DESC' ); $query->set( 'orderby', 'title' ); endif; };
Best regards,
IsmaelMay 23, 2017 at 9:30 am #798117Thanks Ismael, it’s a little bit better:
I’ve put that code in functions.php:
“add_action( ‘pre_get_posts’, ‘ava_pre_get_posts’);
function ava_pre_get_posts($query){
if(is_archive()):
$query->set( ‘order’, ‘ASC’ );
$query->set( ‘orderby’, ‘title’ );
$query->set( ‘items’, ’12’ );
endif;
}”
It’s working because I use only “is_archive” condition.
My ‘tableaux_reglages’ is not a taxonomy but a custom_post_type ; how can I do the test?
I’ve tried “if( get_post_type() == ‘tableaux_reglages’ )” but it’s not working…Can I set the number of items? It’s not working with “$query->set( ‘items’, ’12’ )” …
Please, please!
May 23, 2017 at 9:48 am #798124Ismael,
OK I think I fixed that with ” is_post_type_archive(‘tableaux_reglages’) ”
Can you tell me for “$query->set( ‘items’, ’12’ )”… it’s not working…
One more thing: I want to keep the column left on mobile (to have it before my list) but it’s automatically going after the list on mobile…
How can I fix that?Thanks thanks!
May 24, 2017 at 2:52 pm #798919Hi,
It should be ‘posts_per_page’, not ‘items’.
For new inquiries, please create new thread. Thank you. :)
Best regards,
IsmaelMay 29, 2017 at 1:58 pm #801091Hi Ismael,
Everything is allright now, thanks. It is “posts_per_pages” and not “post_per_page”
Regards
May 30, 2017 at 5:01 am #801340 -
AuthorPosts
- The topic ‘Portfolio file modification issues’ is closed to new replies.