This topic has 9 replies, 3 voices, and was last updated 8 years by tonari.

  • Author
  • #99988
     tonari
    Participant

    Hello,
    i have an issue in my group info page.
    Sorry for this title, i don’t really know how to call this problem.
    I use the “info” tab on my groups page, to show it’s page.
    I have a new page, like any other page, with all the info of my group.
    And i use this php code to call my page.

    COPY CODE
     [PHP]
    // get the page data
    $page_id   = 5127;
    $page_data = get_post($page_id);
    // need to hack WP functions a bit
    global $post;
    $old_post = $post;
    $post = $page_data;
    // Display the content in a WordPress way
    setup_postdata($post); [/PHP]
    
            <div class="content">
            [PHP] the_content(); [/PHP]
        </div>
        
    [PHP] 
    // Now we need to hack it back
    wp_reset_postdata();
    $post = $old_post;
    [/PHP]

    That works really nicely, but, there is one issue, if i set a background color to a container on my page, or add a css to this page, those changes will not be applied inside the “info tab”.

    Do you have any idea how i can fixe that?

    Thanks a lot.
    Regards.

    #100019
     Radu
    Moderator

    Hi,

    Can you please provide the page url where you need to style the info tab ?

    An additional image that pointing out where is the info tab will be helpful

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100029
     tonari
    Participant

    Hello Radu,
    sorry my website is still in dev and hide from the web.
    Here is a picture of the page i’m talking about.
    This is a group.

    Attachments:
    You must be logged in to view attached files.
    #100032
     tonari
    Participant
    This reply has been set as private.
    #100572
     Andrei
    Moderator

    Hi,

    Most probably your content is missing some div wrappers or containers in order to structure the content like it does in a normal page. Give it a look at your page sources and make some comparisons between the content wrappers and add them into your custom code.

    Chers

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100591
     tonari
    Participant

    Hello Andrei, thanks for your answer.
    Indeed some content/css was missing.
    I did not thought of adding the missing css in my style.css … sorry

    But i still have one problem.
    I have to edit this .wpb_content_element on this page, but i don’t want to change this on my other pages, so i tried to add an id to this part after my page is loaded by the php. That works, but that break my text format…
    I can’t use the page id, because it’s a group and i don’t have a page number.

    Do you know how i can do that? Edit this class only on for this page?

    Thanks.

    #100595
     Radu
    Moderator

    Hi @tonari,

    You can style statements only to a certain page by using the unique id class like

    body.page-id-1 , you should check the body classes that your page it have, just made your styles and then put the body.page-id-PAGEID before

    Example : body.page-id-33 .wpb_content_element { color:red; }

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100597
     tonari
    Participant

    Thanks a lot Radu! 🙂

    #100600
     Radu
    Moderator

    You’re welcome

    Have a nice week,

    Cheers

    Radu

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #100607
     tonari
    Participant

    Thanks! same for you 🙂
    Regards

Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?