Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #24735

    Hello, I would like to know how you can integrate a layerSlider in the template archive

    I explained I duplicate the php-template-portofolio Entry.php page and change its name to create a custom page archive comprising advanced search.

    By changing the code on this page and changing the php code page sidebars.php I display a personalized sidebar to this page

    Everything works

    Now I would like to provide change the template and added a manual layerslider so in my php page.

    This slider is created in the admin panel and I want to integrate simply referring to its ID “[layerslider id =” 5 “]” in my new page created

    But I do not know how to modify the php and what lines to add

    /////////////////////////////////////////////////////////////////////////////////////

    Code custom php-template-portofolio Entry.php

    'global $avia_config;

    /*
    * get_header is a basic wordpress function, used to retrieve the header.php file in your theme directory.
    */
    get_header();

    echo avia_title(array('title' => avia_which_archive()));
    ?>

    <div class='container_wrap main_color <?php avia_layout_class( 'main' ); ?>'>

    <div class='container'>

    <div class='template-page template-portfolio content <?php avia_layout_class( 'content' ); ?> units'>

    <div class="entry-content clearfix">
    <?php

    $grid = new avia_post_grid(array( 'linking' => '',
    'columns' => '3',
    'contents' => 'title',
    'sort' => 'no',
    'paginate' => 'yes',
    'set_breadcrumb' => false,
    ));
    $grid->use_global_query();
    echo $grid->html();

    ?>

    <!--end content-->
    </div>

    </div>
    <?php

    //get the sidebar
    $avia_config['currently_viewing'] = 'ProgrammeImmobilier';
    get_sidebar();

    ?>

    </div><!--end container-->

    <?php get_footer(); ?>

    Sincerely,

    Philippe BEAU

    #124540

    Hi Philippe,

    You can use the do_shortcode function from wordpress to output the layerslider wherever you want in the file. See: http://codex.wordpress.org/Function_Reference/do_shortcode

    So something like:

    echo do_shortcode('[layerslider id ="5"]');

    Regards,

    Devin

    #124541

    Thank you, I already try this solution, but when I put it in my archive page code

    echo do_shortcode ([layerslider id = “4”] ‘);

      I have the text [layerslider id = “4”] that appears and not my slider. echo does not interprete the short code

    if I use this code

    echo do_shortcode ([av_layerslider id = “4”] ‘);

    Fatal error: Call to undefined function layerslider_init() in /homez.487/philippewi/www/dcbinternational/wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/slideshow_layerslider.php on line 119

    I’m not a programmer, could you give me an example of php code that works on your side to help me. I recall that it is to modify the archive.php page or portfolio_entry_item.php

    Best Regard

    Philippe BEAU

    #124542

    If its just showing up without rendering, it means it isn’t inside php tags. So you need to wrap the php code inside the proper tags to make it actually be read as php.

    eg:

    <?php echo do_shortcode('[layerslider id ="5"]'); ?>

    #124543

    unfortunately my php tag was well placed

    If I copy this shortcode

    [av_layerslider id = “1”]

    in the content of a page (with text editor in a page or post wordpress) my slider appears

    So I think it lacks a parameter that must be passed which produces the error message when I use the following code

    <php echo do_shortcode ([av_layerslider id = "5"] ');?>

    if I put this code

    <php echo do_shortcode ([layerslider id = "5"] ');?>

    no render code

    I think the shortcode layerslider is not taken is not include and must use av_layerslider but here I find myself with this fatal error

    I try with another short code av_portfolio it works

    so if you have an idea or solution I’m interested

    sincerely,

    #124544

    ok

    If I use this code

    <?php echo do_shortcode ([layerslider id = "5"] ');?>

      in “page.php” and I create a new page with the shortcode [layerslider id = “5”] I will update then I will remove the shortcode

    my page.php code works if I create a new page and I do not put shortcode does not work

    In any case it does not work with the archives pages

    Question is what can be specified in a worlpress uitiliser a dynamic page to search or filter portfolios?

    As a reminder I use a plug-in “Filter Taxonomies Widget” that allows me to have advanced research

    The latter takes into account the different templates

    example of query:

    mypage & post_type = portfolio & tag = & champagne portfolio_entries = Promotion

    mypage is a page defines the interface with worlpress

    Sincerely,

    #124545

    Hi,

    Kriesi recommends that you take the layerslider out and drop it in the plugins folder to use regular layerslider shortcodes. otherwise the slider shortcodes do not work outside the builder. https://kriesi.at/support/topic/how-to-insert-slide-show-with-layerslider#post-118722

    Thanks,

    Nick

    #124546

    Thank you, I try it semblerai it works, but activated the plugin you must first delete the layer slider-config file …. then after activating the copy

    After it works

    Sincerely,

    #124547

    Hi,

    Please open functions.php located in the main theme folder and look for line 299 that looks like

    require_once( 'config-layerslider/config.php' );

    and change it to

    //require_once( 'config-layerslider/config.php' );

    Thanks,

    Nick

    #124548

    Hello, I do not understand the two lines of code are the same ?

    Best regard

    Philipppe BEAU

    #124549

    Hi!

    No, the second line contains // which is a php comment sign. You can also remove the line Nick posted above.

    Best regards,

    Peter

    #124550

    I tried this but it broke the advanced layout editor. Anyone else have the same issue?

    #124551

    Hi ravecomputer,

    As I commented on your other topic this will remove the layerslider from working with the themes elements.

    Regards,

    Devin

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘how I can integrate a layerSlider in the custom template archive ( php code)’ is closed to new replies.