Skip to content

Instantly share code, notes, and snippets.

@marcboivin
Created March 7, 2011 14:01
Show Gist options
  • Save marcboivin/858535 to your computer and use it in GitHub Desktop.
Save marcboivin/858535 to your computer and use it in GitHub Desktop.
Exemple de functions.php comme une étape entre le controlleur et la view
<?php
/**
* Methods used to build the theme's templates. These methods encapsulate the
* verifications and fallbacks that account for the availability of plugins,
* configuration options, or PHP/WordPress features.
*/
class Theme
{
/**
* Displays alternative search results, if available.
*/
public static function alternative_search_results()
{
if (class_exists(Search))
{
Search::suggest_alternative_results();
}
}
/**
* Displays the profile of the current idea's author, if available.
*/
public static function author_profile()
{
if (method_exists(Profile, get_control))
{
echo '
<div
class="author user_profile">
' . Profile::get_control() . '
</div>
';
}
}
/**
* Displays a class attribute for the body tag, appending the navigation
* mode to the list of classes.
*/
public static function body_class_nav_mode()
{
global $ma14_nav_mode;
body_class($ma14_nav_mode);
}
/**
* Displays the comments control, if available.
*/
public static function comments_control()
{
global $wp_query;
if (function_exists(ma14_comments_template))
{
// If there is only one post, we force comments on it.
$force = 1 === $wp_query->post_count;
custom_comments_template($force);
}
}
}
@marcboivin
Copy link
Author

<div
    id="post-<?php the_ID() ?>"
    <?php post_class() ?>>
    <?php
        if( 'idee' == $post->post_type):
    ?>
     <div class="recherche"><?php Theme:: alternative_search_results ?></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment