Pages?

  • Anonymous

    #17686

    Well, you can re-position it with css to wherever you like. I just think the footer is an easier hook to keep of the homepage than the after content. (although I have no idea)

    That is, if the function does what it’s supposed to. That’s what I want to know.

    But, if you keep it in the after content… your function should look exactly like this:

    function laura_sharethis (){
    if (!is_home()) {
    ?>
    <div id="sharethis"><span class='st_twitter_hcount' displayText='Tweet'></span><span class='st_facebook_hcount' displayText='Facebook'></span><span class='st_fblike_hcount' ></span><span class='st_plusone_hcount' ></span></div>
    <?php
    }
    }
    add_action( 'graphene_after_post_content', 'laura_sharethis' );

    Anonymous

    #17687

    You’re right. If you position it from the footer, it’s always going to show up in the same spot… regardless of the post width.

    Scratch the footer idea πŸ™‚

    raindance

    #17688

    πŸ™‚

    Anonymous

    #17689

    Once more… let’s try this one if the above doesn’t work.

    function laura_sharethis (){
    if(!(is_home())){
    ?>
    <div id="sharethis"><span class='st_twitter_hcount' displayText='Tweet'></span><span class='st_facebook_hcount' displayText='Facebook'></span><span class='st_fblike_hcount' ></span><span class='st_plusone_hcount' ></span></div>
    <?php
    }
    }
    add_action( 'graphene_after_post_content', 'laura_sharethis' );

    raindance

    #17690

    Nope, same. Let’s leave it. I know you have your own long list of stuff.

    I’m going to give some more thought to how I actually want the home page to be.

    Thanks πŸ™‚

    I’m also still banging my head against the ambrosite plug in. It’s making me nuts. I can’t get them to work together and I know it has something to do with the function in my functions file for the post plug in.

    Anonymous

    #17691

    Okay. I’m gonna leave this thread alone. I’ll switch to your other thread about the navigation. We are leaving this thread with this question:

    1. How do you get content to display either ONLY on the home page, or NEVER on the home page.

    raindance

    #17692

    Exactly πŸ™‚

    Admin

    Syahir Hakim

    #17693

    If you could give a gist of the discussions in this thread, that would be helpful. Four pages of discussion is just too long…

    Anonymous

    #17694

    Apologies Syahir,

    I believe we have figured it out.

    A lot of this thread was just tweaking a specific plugin…. however, one question remains when using created functions inserted into the child functions.php.

    For instance, if we have this function in our child..

    function josh_followme(){
    ?>
    <div id="followme"><img src="http://www.joshlobe.com/wp-content/images/follow.png"></div>
    <?php
    }
    add_action( 'graphene_feed_icon', 'josh_followme' );

    I know there are “if” statements we can use to control which pages it will show on. We tried using if (!is_home()) { to keep it from showing on the front page. After further experimentation, we used if (!is_front_page()) { to keep from showing on the home page, but showing on all other pages.

    I was wondering where we can find these is_home and is_front_page attributes.

    Admin

    Syahir Hakim

    #17695

    By attributes do you mean a documentation for those functions? If yes, you can find them here:

    http://codex.wordpress.org/Function_Reference/is_front_page

    http://codex.wordpress.org/Function_Reference/is_home

    Also, note that when using the conditional functions like is_home() and is_front_page() in the functions.php file, keep in mind that the functions.php file is executed way ahead of the other query processing that determine which page to display in your site.

    Meaning that if you use those conditionals like this:

    function josh_followme(){
    ?>
    <div id="followme"><img src="http://www.joshlobe.com/wp-content/images/follow.png"></div>
    <?php
    }
    if ( is_home() ){
    add_action( 'graphene_feed_icon', 'josh_followme' );
    }

    It will not work because is_home() then will always return false, because at the time when that code is executed WordPress doesn’t know yet what page it will be serving.

Viewing 10 posts - 51 through 60 (of 63 total)

  • You must be logged in to reply to this topic.
Graphene Themes Forum