ThemeShaper Forums » Thematic

Filtering Out Content from index.php

(6 posts)
  • Started 10 years ago by seamusiv
  • Latest reply from seamusiv
  • This topic is resolved
  1. I am using the Featured Content Gallery on my homepage to highlight recent projects.

    In my old Thematic files I had just changed the index.php file to call in the gallery, but moving forward I'd like to just make the change to my functions.php file.

    Currently my index.php looks like this:

    <?php
    global $options;
    foreach ($options as $value) {
        if (get_settings( $value['id'] ) === FALSE) { $$value['id'] = $value['std']; }
        else { $$value['id'] = get_settings( $value['id'] ); }
        }
    ?>
    <?php get_header() ?>
    <div id="container">
    		<div id="content">
    <?php get_sidebar('index-top') ?>
    <?php include (ABSPATH . '/wp-content/plugins/content-gallery/gallery.php'); ?>
    
    		</div><!-- #content -->
    	</div><!-- #container -->
    
    <?php get_sidebar() ?>
    <?php get_footer() ?>

    How do I filter out the content in the index.php file for 0.8.1 to reflect this?

    I've followed the directions here before, but I am a relative PHP newb and am not sure what the correct filter would be...

    Posted 10 years ago #
  2. Hey seamusiv,

    to see how the correct filter works copy this to your functions.php and see what happens.

    `
    function lowertypo($content) {
    return strtolower($content);
    }
    add_filter('the_content', 'lowertypo');
    `

    All words in your content are now in lowercase.

    Posted 10 years ago #
  3. Ok .. had a look into this one. In this special case you don't need to filter anything at all. This is classical CMS setup.

    1.) Rename your changed index.php and make it a template.
    2.) Create a page using this template
    3.) Under Reading Settings switch Frontpage displays to static page
    4.) Choose the page you created as Front Page

    Just in case you still need a 'Blog' thing:
    5.) Take the original index.php, rename it, make it a template
    6.) Create a page using this template
    7.) Choose the page you created as Posts Page

    Possible that I missed something, but more or less this should be the way to follow in your case.

    Cheers,

    Chris

    Posted 10 years ago #
  4. Thanks for the feedback.

    @Chris, if I was going to create a template, wouldn't it just be simpler to create an index.php file (using the content above) in my Child Theme directory?

    Posted 10 years ago #
  5. @seamusiv .. as long as you're creating something for yourself, you can do whatever is easier .. as soon as you're starting to create a child theme for others, it's better to follow at least a couple of guidelines ;-)

    Posted 10 years ago #
  6. Cool. Thanks for your help!

    Posted 10 years ago #

RSS feed for this topic

Reply

You must log in to post.