Ready to get started?Download WordPress


Automatic Section formatting to the_content via template function (3 posts)

  1. rideforver
    Posted 7 years ago #

    Hi there,

    I'm running an expedition across the Gobi desert and am designing WP to be my ongoing journey blog. This means that I can only email posts and must rely on automated formatting via templates and CSS for each entry.

    Is there a way using template tags to separate a post's 'content' into sections so that each can be called separately into a template and positioned/formatted using CSS. I find the bulk of the_content() function too unweildy and unable to give me the design I need.

    For example: I'd like to format the_content(upper) differently from the_content(middle) and the_content(lower).

    How can this be achieved?

    Regards Stephen

  2. yosemite
    Posted 7 years ago #

    If I understand you correctly, you should be able to define that in the text you send, e.g;
    <p class="para1"> blah-blah </p>
    <p class="para2"> blah-blah-blah-blah-blah-blah </p>
    <p class="para3"> blah-blah </p>

    Assuming following is defined in your stylesheet:
    .para1 { font-size:1.1em; }
    .para2 { font-size:0.8em; }
    .para3 { font-size:1em; font-weight:700;}

    This clicking?

  3. rideforver
    Posted 7 years ago #

    Yeah, Thanks Yosemite, I've been working in unknown territory all day and I realised I could use CSS after I'd posted. Your reply at least shows I'm going down the right road. I'm just figuring my way around WP one function and page at a time. Cheers.

Topic Closed

This topic has been closed to new replies.

About this Topic