Investica Part Four

Only one last thing we need to do for the two column post layout and that is to move the image below the title, as Artisteer have moved the post output we cannot change the layout in the page or content files, so we will change the code.

We have to stop and consider the rest of our pages that might use the thumbnail, these may include the search results, category and later a magazine style single category page, so we will leave the core function alone but copy and rename it for the homepage two column output.

inv-functions.php

We open the file in the /library/ folder called wrappers.php, there is a block of code which is our post output called theme_post_wrapper then we select and copy this function lines twelve to fifty six 12-56 to the clipboard.

Download Investica Part Four Files: Investica Part Four (560)

Now we open the file in the /library/ folder called inv_functions.php we created in the earlier part, and we paste in the code from the clipboard, and we will change the function name which should be on line 17 we change this to:

function theme_homepage_wrapper($args = '') {

Cut line  echo $thumbnail; to the clipboard and paste this on a new line after the closing tag three lines down, the function code in inv-function.php should now look like this:

function theme_homepage_wrapper($args = '') {
    $args = wp_parse_args($args,
        array(
            'id' => '',
            'class' => '',
            'title' => '',
            'thumbnail' => '',
            'before' => '',
            'content' => '',
            'after' => ''
        )
    );
    extract($args);
    if (theme_is_empty_html($title) && theme_is_empty_html($content)) return;
    if ($id) {
        $id = ' id="' . $id . '"';
    }
    if ($class) {
        $class = ' ' . $class;
    }
    ?>
<div class="art-post<?php echo $class; ?>"<?php echo $id; ?>>
        <div class="art-post-body">
                <div class="art-post-inner art-article">
                <?php
                    if (!theme_is_empty_html($title)){
                        echo '<h2 class="art-postheader">'.$title.'</h2>';
                    }
                    echo $thumbnail;
                    ?>
                    <div class="art-postcontent">
                        <!-- article-content -->
                        <?php echo $content; ?>
                        <!-- /article-content -->
                    </div>
                    <div class="cleared"></div>
                    <?php
                ?>
                </div>
            <div class="cleared"></div>
        </div>
    </div>
    <?php
}

 

All we have done here is changed the name of the function and moved the image below the post or page title, this now looks like the html example.

content-home.php

In the main theme folder we open content-home.php and call our custom function with the new modified layout, with the title above the featured image.

We find theme_post_wrapper(

Change this to theme_homepage_wrapper(

lesson-4-1

In the next part we are adding an extra feature to our theme, the pages are a little boring so we will add a custom subtitle to pages and posts, this will be a h2 tag and can be used for SEO enhancement.

Notices

We do require your feedback to improve our themes and tutorials, please leave your comments good or bad.

Code disclaimer information

If this document contains programming examples, www.DigitalRaindrops.net grants you a nonexclusive copyright license to use all programming code from which you can generate similar functions tailored to your own specific needs.

All sample code is provided by http://DigitalRaindrops.net for learning illustrative purposes only.

These examples have not been thoroughly tested under all conditions. www.DigitalRaindrops.net, therefore, cannot guarantee or imply reliability, serviceability, or function of these examples.

All programs contained herein are provided to you “AS IS” without any warranties of any kind. The implied warranties of non-infringement, merchantability and fitness for a particular purpose are expressly disclaimed.

Membership

Registration and Membership is no longer required for downloading files or interacting with Digital Raindrops, posting a comment or topic in the forum does use Captcha to reduce spammers.

This website is a tool to support and promote WordPress and Artisteer theme development, please support, share and give credit for any benefits you gain from the tutorials on this website.

One thought on “Investica Part Four

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Connections

Connect with Us
Follow Digital Raindrops on Twitter Join Digital Raindrops on Facebook
Share

Related Posts

Posted in Artisteer

googlefonts11.png

As Artisteer users one of the first things many of us do is add code to hide the titles, we often do this for the simple reason that the default fonts are safe and boring, so in this post we … Continue reading

Read More

Posted in Investica

lesson-1-thumb

This is the first in a series of posts and code tutorials we are running in April 2011, these are Artisteer based and there has been a slight delay, as a new version of Artisteer was released on the 4th … Continue reading

Read More