• Resolved Mike K.

    (@jhatcher12)


    Hi there,

    Great plugin. Already gave you 5 stars. It changes the way I design my clients’ website. Perfect plugin. One question though:

    Whenever I call a page using PHP no css and background show up. This is the code I use:

    <?php
    $id = 464;
    $p = get_page($id);
    echo apply_filters('the_content', $p->post_content);
    ?>

    Any page created by your plugin doesn’t show up the way it should. No background, padding etc.

    Thanks.
    Mike

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Support Rohan Khandeparkar

    (@rohanvc)

    Hi Mike,

    It is advisable to have a loop when you do it. For eg:

    $postId = 4;
    $args = array(
    'p' => $postId,
    );
    $loop = new WP_Query($args);
    if ( $loop->have_posts() ) :
    while ( $loop->have_posts() ) : $loop->the_post();
    the_content();
    endwhile;
    endif;

    A more convenient way is to use our special API method for it:

    $postId = 4;
    $frontendHelper = vchelper('Frontend');
    $content = $frontendHelper->renderContent($postId);
    echo $content;

    Thanks,

    Thread Starter Mike K.

    (@jhatcher12)

    Thanks, Rohan. The first code didn’t work at all. The second code does what my code does. It still doesn’t show the background image, line-break or padding. Please advise.

    Plugin Support Rohan Khandeparkar

    (@rohanvc)

    Hi,

    We tried adding a background and margin for a row element: https://i.imgur.com/Z4neOK2.png
    Then used the same code that outputs it for a single.php template: https://i.imgur.com/NLezjkQ.png
    However, when we visit the page, it is rendering the background and margin: https://i.imgur.com/CAUzkE1.png
    We would request you to kindly drop us a ticket via the support portal: https://help.visualcomposer.com/support

    Thanks,

    Thread Starter Mike K.

    (@jhatcher12)

    Thanks for your reply. Here is the footer of the site I’m working on and the footer doesn’t show the line break and padding: https://anemailtoremember.com/dan/links/

    I use the same code you suggested. Please advise. Thanks in advance.

    Plugin Support Rohan Khandeparkar

    (@rohanvc)

    Hi,

    Since the code works on our setup, the same code should have worked on your setup as well. As it does not work on your setup, it looks like something on the setup might be causing the issue.
    Unfortunately, the footer URL does not help us in locating the issue source and suggest a solution based on it.
    Hence, we would request you to kindly reach us via our support portal: https://help.visualcomposer.com/support

    Thread Starter Mike K.

    (@jhatcher12)

    I don’t know what “set up” you are referring to so I can check. The link you sent asks me to become a Premium Member in order to submit a ticket. Simply, I used the code and that works with everything but with the plugin. It’s OK if you don’t know what’s wrong with that. I’ll dig in deeper. Thanks.

    Plugin Support Rohan Khandeparkar

    (@rohanvc)

    Hi,

    By setup we mean WordPress setup.
    A premium license will allow you to obtain help from the support team in case you face any issues while using the plugin or while implementing any functionality.
    Apart from this, it will also allow access to premium features such as premium elements, header and footer builder, popup builder, etc. You can check more details of premium features here: https://help.visualcomposer.com/docs/getting-started/free-vs-premium/

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Calling a page doesn’t work’ is closed to new replies.