Tagged: ,

Viewing 29 posts - 1 through 29 (of 29 total)
  • Author
    Posts
  • #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)

    #769767

    Hello, please can I have some help? It is quite urgent, thanks!

    #769975

    Hi Wazzabi,

    Please refer to this thread for a possible solution.

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #770102

    Thank 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,

    #770379

    Hi 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,
    Victoria

    #771029

    Thanks 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/kJFMkZXH

    Here is the file calling the portfolio:
    https://pastebin.com/JXUS9Ahr

    I 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,

    #772776

    Hi,

    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,
    Andy

    #773726

    Now 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)….?
    Thanks

    #774456

    Hi 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,
    Victoria

    #774836

    Thanks 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,

    #776221

    Hi 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,
    Victoria

    #776230

    How can I deactivate lightbox?

    That’s my question
    Thanks

    #777535

    Hi 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,
    Victoria

    #779837

    Hello,

    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

    #780448

    Hi Wazzabi,

    Sidebar can be set to left position in theme options.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #780503

    Thanks 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,

    #782651

    Hi,

    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,
    Ismael

    #794270

    Hi,

    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?
    Thanks

    #794286

    Hi 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 left

    I 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

    #795532

    Hi,

    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,
    Ismael

    #795834

    Ismael,

    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!!
    Thanks

    #797366

    Hi,

    Please post the WP and FTP login details so that we can test the filters thoroughly.

    Best regards,
    Ismael

    #797748

    Ismael,

    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/kJFMkZXH

    Here is the file calling the portfolio:
    https://pastebin.com/JXUS9Ahr

    Help!
    Thanks

    #798069

    Hi,

    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,
    Ismael

    #798117

    Thanks 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!

    #798124

    Ismael,

    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!

    #798919

    Hi,

    It should be ‘posts_per_page’, not ‘items’.

    For new inquiries, please create new thread. Thank you. :)

    Best regards,
    Ismael

    #801091

    Hi Ismael,

    Everything is allright now, thanks. It is “posts_per_pages” and not “post_per_page”

    Regards

    #801340

    Hi,

    Great! Thank you for the confirmation. :)

    Best regards,
    Ismael

Viewing 29 posts - 1 through 29 (of 29 total)
  • The topic ‘Portfolio file modification issues’ is closed to new replies.