Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #333294

    The problem is simple. I’m wanting to add an exact button that is output with shortcode into my single.php file for every single post on my website template.

    Here is the code I’m wanting to add:

    [av_button label='Download Detailer' link='manually,http://#' link_target='_blank' color='red' custom_bg='#444444' custom_font='#ffffff' size='medium' position='left' icon_select='yes' icon='ue850' font='entypo-fontello' custom_class='detailer-button']

    But unfortunately, the post outputs the text rather than the generated button via shortcode. Is there a simple way to do this? I can’t find a solution anywhere.?

    #333659

    Hey BrianBookwalter!

    Thank you for using Enfold.

    Please use the do_shortcode function. Refer to this link: http://codex.wordpress.org/Function_Reference/do_shortcode

    Best regards,
    Ismael

    #715291

    Hi,

    I’m facing the same issue. I’d like to have a full width slider in my single post page. For that reason I duplicated the single.php and put it in my Child theme. After looking at the codex page you refer to, I tried this code:

    echo do_shortcode('[av_slideshow size='no scaling' animation='slide' autoplay='false' interval='5' control_layout='av-control-default' custom_class='']
    [av_slide slide_type='image' id='328' video='' mobile_image='' video_ratio='' title='' link_apply='' link='lightbox' link_target=''][/av_slide]
    
    [/av_slideshow]');

    Or this one:

    <?php echo do_shortcode('[av_slideshow size='no scaling' animation='slide' autoplay='false' interval='5' control_layout='av-control-default' custom_class='']
    [av_slide slide_type='image' id='328' video='' mobile_image='' video_ratio='' title='' link_apply='' link='lightbox' link_target=''][/av_slide]
    [/av_slideshow]');?>

    In both cases, no luck. Do I have to put this code somewere in order to make it work?

    function do_shortcode( $content, $ignore_html = false ) {
        global $shortcode_tags;
     
        if ( false === strpos( $content, '[' ) ) {
            return $content;
        }
     
        if (empty($shortcode_tags) || !is_array($shortcode_tags))
            return $content;
     
        // Find all registered tag names in $content.
        preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
        $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
     
        if ( empty( $tagnames ) ) {
            return $content;
        }
     
        $content = do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames );
     
        $pattern = get_shortcode_regex( $tagnames );
        $content = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $content );
     
        // Always restore square braces so we don't break things like <!--[if IE ]>
        $content = unescape_invalid_shortcodes( $content );
     
        return $content;
    }

    Help is much appriciated!

    Cheers,

    Steven

    #716279

    Hi,

    Instead of editing the single.php file, please add this code in the functions.php file.

    add_action('ava_after_main_title', 'ava_after_main_title_mod');
    function ava_after_main_title_mod() {
    	if( is_singular('post') ) {
    		echo do_shortcode("[av_slideshow size='no scaling' animation='slide' autoplay='false' interval='5' control_layout='av-control-default' custom_class=''][av_slide slide_type='image' id='328' video='' mobile_image='' video_ratio='' title='' link_apply='' link='lightbox' link_target=''][/av_slide][/av_slideshow]");
    	}
    }

    Best regards,
    Ismael

    #716366

    Hi Ismael,

    Thanks for the code. It does work. However there’s a dark grey area just above the header image what I can’t explain. You maybe?

    Regards,

    Steven

    #716645

    Hi Steven,

    I get a 404 page on the URL you posted, could you check please?

    Best regards,
    Rikard

    #716744

    Sorry wrong URL…

    Cheers,

    Steven

    #717136

    Hi Steven,

    Sorry but I get a 404 page there as well :/

    Best regards,
    Rikard

    #717260

    Hi Rikard,
    Sorry, my bad.. It’s a file that is updated automaticly so the URL changes… Just made a “static” post.

    #717284

    Hey!

    Please add
    .avia-slideshow { margin: 0px !important; }

    and we will be happy to help you.

    Thanks a lot

    Cheers!
    Basilis

    #718174

    Hi,

    Worked! Thanks. What would the right code be if I want to show the logo over the image like on the frontpage? In debug mode I see this code of the slider on my frontpage (see link in PC):

    [av_slideshow_full size='no scaling' stretch='' animation='slide' autoplay='false' interval='5' control_layout='av-control-default' src='' attachment='' attachment_size='' position='top left' repeat='no-repeat' attach='scroll' custom_class='']
    [av_slide_full slide_type='image' id='328' video='http://' mobile_image='' video_format='' video_ratio='16:9' title='<img src="http://185.27.141.7/~ptsy386879/wp-content/uploads/2016/11/logo-studijob.png" class="sliderlogo">' custom_title_size='' custom_content_size='' caption_pos='caption_left' link_apply='' link='lightbox' link_target='' button_label='Click me' button_color='light' link1='manually,http://' link_target1='' button_label2='Click me' button_color2='light' link2='manually,http://' link_target2='' font_color='' custom_title='' custom_content='' overlay_opacity='0.5' overlay_color='' overlay_pattern='' overlay_custom_pattern=''][/av_slide_full]
    [/av_slideshow_full]

    When I replace your code:
    [av_slideshow size='no scaling' animation='slide' autoplay='false' interval='5' control_layout='av-control-default' custom_class=''][av_slide slide_type='image' id='328' video='' mobile_image='' video_ratio='' title='' link_apply='' link='lightbox' link_target=''][/av_slide][/av_slideshow]

    With the “debug” one, PHP error because of the http in the code…

    Regards,

    Steven

    #720124

    Hi,

    I’m sorry but I can’t see the “dark gray” area in the page. Could you please provide a screenshot of the issue? Is the “blue space” above the image intentional?

    // http://185.27.141.7/~ptsy386879/wp-content/uploads/2016/11/header-vervolgpagina-1500×607.jpg

    Best regards,
    Ismael

    #720935

    Hi,

    That’s right because Basilis gave me the solution to remove the gray area. My follow up question was: What would the right code be if I want to show the logo over the image like on the frontpage? See my previous post. And the blue space is part of the image..

    Cheers,

    Steven

    #722317

    Hi,

    The test pages are gone. Could you please re-create those pages again so that we can inspect it?

    // http://185.27.141.7/~ptsy386879/2016/11/26/test2/
    // http://185.27.141.7/~ptsy386879/2016/11/26/test

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.