• Resolved popsantiago

    (@popsantiago)


    Hello,

    I made a page template using [forum forum=”1″] with Visual Composer.
    Everything is ok.
    But i did it with php template to make easier the admin of this specific page.

    $formation_content_media = '[mk_page_section][vc_column_text][forum forum="1"][/vc_column_text][/vc_column][/mk_page_section];
    echo do_shortcode($formation_content_media);

    Css fails.
    https://snag.gy/fwLqCn.jpg
    Seems like css of is not enqueue ?

    Any idea ?

    Thanks

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Asgaros

    (@asgaros)

    Hello,

    vc_column is not opened in your example, but closed.

    I am not sure what those other plugins exactly do. In Asgaros Forum I check, if a shortcode exist inside the page-content. Maybe this is a compatibility issue with the other plugins.

    Thread Starter popsantiago

    (@popsantiago)

    Hello,

    Thanks for reply.
    Humm i erased the the_content() for my custom content php maybe it’s the problem ?

    How can force the enqueue style and script ?

    The only way is using a the_content() filter ?

    Thanks

    Plugin Author Asgaros

    (@asgaros)

    Have you set the location-page correctly in the forum-settings?

    An alternative would be to add the js/css files hardcoded to your theme manually.

    Thread Starter popsantiago

    (@popsantiago)

    Hello,

    I have a parent page with 4 child pages for 4 forums.
    How can i do ?

    To add it manually, what i need to add ? (js/css).

    Thanks

    See you.

    Laurent

    Plugin Author Asgaros

    (@asgaros)

    Just include the following files manually in your themes head-html-area:

    asgaros-forum/skin/mobile.css
    asgaros-forum/skin/style.css
    asgaros-forum/js/script.js

    Thread Starter popsantiago

    (@popsantiago)

    Hello,

    I tried but something is wrong.

    When i used Visual Composer to add [forum forum=”1″] i have only the forum for my ID her 1. >>> https://snag.gy/xEkchz.jpg
    When i make echo do_shortcode(‘[vc_row][vc_column][vc_column_text][forum forum=”1″][/vc_column_text][/vc_column][/vc_row]’);
    I have all my Forum… And it seems missing css >>> https://snag.gy/vVWP2a.jpg

    Any idea ?

    Thanks

    Plugin Author Asgaros

    (@asgaros)

    Screenshot 2 looks fine for me regarding the css-problem. But it seems, that your theme is overwriting the icons or uses an own icon-font.

    Maybe its also a problem with nested shortcodes. Is it working correctly when you are using it without all the vc-stuff?

    Thread Starter popsantiago

    (@popsantiago)

    Hello,
    Sorry for delay i was in holidays.

    The two screenshots are not same. They have the same shortcode > [forum forum=”1″] :
    – When the shortcode is in the content everything is ok, i see only the forum ID.
    – When i make the do_shortcode function, the argument forum=”1″ is not parse… I have all forum not only the ID.
    Any idea ?
    Thanks

    Plugin Author Asgaros

    (@asgaros)

    Hello @popsantiago

    Please check your quotation marks and ensure you are using this code:

    [forum forum="1"]

    Thread Starter popsantiago

    (@popsantiago)

    Hello,

    Yes i use this quotation…
    Like css are not charge, maybe a js is not charge too ?

    Thanks.

    Plugin Author Asgaros

    (@asgaros)

    I am not sure, I think it is a compatibility issue with one of your plugins or your theme. I dont exactly know what Visual Composer is doing because its a third-party-plugin.

    You can try to test if its working when you place it on a normal template-page where nothing got deleted.

    Thread Starter popsantiago

    (@popsantiago)

    Hello,

    I made a test with a fresh install WP.
    Default WordPress Theme, no visual composer…
    And it doesn’t work.

    I can’t use filter :

    function pippin_filter_content_sample($content) {
    	if( is_singular() && is_main_query() ) {
    		$content = do_shortcode( '[forum forum="1"]' );	
    	}	
    	return $content;
    }
    add_filter('the_content', 'pippin_filter_content_sample');

    The css and the js are not enqueue with this method…

    Any idea ?

    Thank.

    Plugin Author Asgaros

    (@asgaros)

    You have to write the shortcode directly into the content of your page because I only load the css/js-files when it is included in a page (to avoid traffic in other pages).

    In your case you add the shortcode manually at a later point of time where the html-head generation is already done.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Php do_shortcode() mix with Visual > Css fails’ is closed to new replies.