• Resolved imccullough

    (@imccullough)


    I cannot seam to find the function ‘the_content()’ I have searched every file (including the functions.php) and can’t seem to find it. I am reluctant to state the actual task I want to perform because I would really like the answer to where this function resides and often the original question gets gossed over with the answer to a myriad of other solutions. However, what I want to do is add a div in the body (somewhere inside the content div, I will figure that out where when I find where the content page is constructed), so that I can add an opacity style to set the transperency of the main content background (maybe minamaze could add that feature to the options menu?). So if anyone knows where to find this elusive function that would be great. Thanks.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi there!

    It’s in content-page.php and content-single.php .

    I’ll avoid commenting on your task πŸ™‚

    I hope that helps!

    Luke the Daft Duke

    Thread Starter imccullough

    (@imccullough)

    I found where it is called in the content-page.php etc. but I can’t find where the actual function is so that I can modify it’s code. Also feel free to comment on the task, if there is an easier way I definitely want to know. </Thanks>.

    Hi there!

    I’m not really sure I understand what you want to do.

    The actual function the_content() is located in wp-includes/post-template.php – see its page at the WordPress Codex.

    If you want to add a div inside <div id="content"> – you’ll find that inside the header.php file.

    However, I’m not sure that will help you complete your task. If you post a link to your website I can suggest some CSS to make the main content background transparent for you.

    πŸ™‚

    Luke the Daft Duke

    Thread Starter imccullough

    (@imccullough)

    The site is http://www.homewoodcraft.com. I had successfully created transparent backgrounds on a previous project by putting a div with opacity styles inside a container div like this <div id="container"><div class="Transparent_Container"></div><!--the content for the container div--></div> but if there is a better way I would love to know it.

    Is this what you are trying to achieve?

    Screenshot

    If so, try adding this to your custom css or child theme style.css:

    body, #body-core {
      background: none repeat scroll 0 0 white 0.6;
     }

    Hope I’ve understood you correctly! πŸ™‚

    Thread Starter imccullough

    (@imccullough)

    Yes that is pretty much it. I was actually going for semi-transparent rather than completely. Would that be a change in the decimal of the white attribute?

    Try this:

    body, #body-core {
      background: none repeat scroll 0 0 rgba(255, 255, 255, 0.5);
    }

    You can adjust the decimal after the last 255 to change the transparency of the white.

    Thread Starter imccullough

    (@imccullough)

    Worked like a charm, Thank you. Now I just have to get the background to stay fixed and not scroll with the page.

    See if this works:

    body.custom-background {
      background-attachment: fixed;
    }
    Thread Starter imccullough

    (@imccullough)

    Yes I kept running into an issue with the options for the theme and was able to change those attributes through the theme options. Every time I would try to do it with the css in my child theme it would get overridden by the options. I appreciate your help. I am going to mark this as resolved rather than go through any more off topic issues so it stays relevant to the topic. Thanks again
    </>
    –Ian

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

The topic ‘Where can I find the 'the_content()' function?’ is closed to new replies.