shenanigans

Forum Replies Created

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • in reply to: Infinite scroll with child theme #4106

    shenanigans
    Participant

    Hey guys,

    after trying for days to make this work, I’ve given up on this. However, I am now going to integrate a conventional pagination which also doesn’t work as expected…

    I’m going to open another thread so this one here can be closed or deleted.

    Thanks…

    in reply to: Message from Helgatheviking: Forking Thematic #1715

    shenanigans
    Participant

    A big thank you, Kathy for all your support and help — bilding my WP site wouldn’t have been so successful without your input. Good luck and all the best for the future, I’m going to check out your framework once it’s available…

    in reply to: Different php thematic_postheader() ? #1544

    shenanigans
    Participant

    Ok, I’ve changed everything to the_title, and called the classes accordingly. Works — mission accomplished 🙂

    in reply to: Different php thematic_postheader() ? #1541

    shenanigans
    Participant

    No, I’m afraid, I wasn’t aware of that. However, the CSS code you posted has no effect on my headers in search results. It does work, if I’m calling my excerpts/teasers on a static page (like telling it to display… say, the six latest excerpts of category a and the six latest excerpts of category b). What I also noticed is, that it’s giving me a h2 headline (in search results) instead of an h1 headline (on static pages, where I’m telling it what to show).

    I’m convinced, that I’m making some silly mistake for that I’m just getting into PHP and started to scratch the surface, but what I find irritating is, that when I use

    
    <a <?php post_class(); ?> href=”<?php the_permalink(); ?>”><?php thematic_postheader(); ?></a>
    
    

    …it doesn’t include the classes in my href-link, which (as I understand it) prevents me from calling category related classes. It’s calling the classes, but instead of including it in the link, it puts (in Firebug greyed out) code in front of the actual link twice.

    
    <div class=”hentry_start”>
    
    — greyed out from here–> <a class=”post-150 post type-post status-publish format-standard hentry category-blog tag-south-park” href=”http://…”> </a><– greyed out till here —
    
    
    <h2 class=”entry-title”>
    
    
    – greyed out from here —> <a class=”post-150 post type-post status-publish format-standard hentry category-blog tag-south-park” href=”http://…”></a> <– greyed out till here —
    
    
    <a rel=”bookmark” title=”Permanent-Link zu TestTestTest” href=”http://…”>TestTestTest</a>
    
    
    </h2>
    
    

    I can only address all headers in the search result, by styling .entry-title . Again, this only effects my search results, the headers work just fine on static pages, and I am able to style each header accordingly.

    Update: I replaced thematic_postheader() with the_title():

    
    <a <?php post_class(); ?> href=”<?php the_permalink(); ?>”><?php the_title(); ?></a>
    
    

    …and that seems to work in my search results, also… That’s kinda strange, what am I doing wrong?


    shenanigans
    Participant

    well, I guess I’m just thinking too complicated sometimes 🙂

    Thank you, helgatheviking


    shenanigans
    Participant

    Could I use

    function childtheme_override_postheader_posttitle()

    in my functions.php and proceed with an if-statement? Something like this:

    
    <?php
    function childtheme_override_postheader_posttitle() {
    
    $posttitle = “\n\n\t\t\t\t\t”;
    if (in_category(‘blog’)) {
    $posttitle .= ‘<h1>’ . get_the_title() . “</h1>\n”;
    }
    if (in_category(‘some_category’)) {
    $posttitle .= ‘<h1>’ . get_the_title() . “</h1>\n”;
    }
    elseif (is_404()) {
    $posttitle .= ‘<h1>’ . __(‘Not Found’, ‘thematic’) . “</h1>\n”;
    } else {
    $posttitle .= ‘<h2><a href=”‘;
    $posttitle .= apply_filters(‘the_permalink’, get_permalink());
    $posttitle .= ‘” title=”‘;
    $posttitle .= __(‘Permalink to ‘, ‘thematic’) . the_title_attribute(‘echo=0’);
    $posttitle .= ‘” rel=”bookmark”>’;
    $posttitle .= get_the_title();
    $posttitle .= “</a></h2>\n”;
    }
    
    return apply_filters(‘thematic_postheader_posttitle’,$posttitle);
    
    }
    // end postheader_posttitle
    ?>
    
    

    shenanigans
    Participant

    The approach above is also problematic when a post is filed under two categories at the same time…


    shenanigans
    Participant

    Hey again,

    So here’s what I came up with:

    <a <?php post_class(‘default’); ?> href=”<?php the_permalink(); ?>”><?php thematic_postheader(); ?></a>

    Which does work, because it adds all the post related classes to my headline, which I can then address via CSS.

    <a class=”post-133 post type-post status-publish format-standard hentry category-blog tag-captain-crunch tag-hamburger tag-johnny default” href=”…”>

    However, this also causes problems. I have to specify every other normal a:link for example… I feel that it would be smarter, to work with .entry-title in the posttitle instead?


    shenanigans
    Participant

    thank you! I’ll leave it for now, as I’ve got a handful of other design requirements to meet, but I’ll look into it again and try to optimize the code…

     


    shenanigans
    Participant

    Hey there,

    thanks for you hint, helgatheviking. It seems like I found a way to address the common user. So I want to show a post’s tags and a ‘Edit’-link, when an admin is logged-in. I’d like to show the tags only (and maybe category, I have to work that out later) when visitors are on the webpage.

    Below’s the code I came up with. It feels a little clumpsy, especially the part where I’m calling two IF’s in a row. I don’t know if that’s smart or not, however it seems to work at least in FF, Safari and Chrome and there’re many ways to skin a cat, I guess. Could someone please verify if the code is ok? If anyone got a better approach, I’d be thankful for any hint, as I’m determined to work this out by myself (at least as much as possible). Cheers 🙂

    
    function childtheme_override_postfooter() {
    
    $post_type = get_post_type();
    $post_type_obj = get_post_type_object($post_type);
    
    // Check for “Page” post-type and logged in user to show edit link
    if ( $post_type == ‘page’ && current_user_can(‘edit_posts’) )
    {
    $postfooter = ‘<div>’ . thematic_postfooter_posteditlink();
    $postfooter .= get_the_tag_list();
    $postfooter .= “</div><!– .entry-utility –>\n”;
    // Display nothing for logged out users on a “Page” post-type
    }
    elseif ( $post_type == ‘page’ )
    {
    $postfooter = ”;
    // For post-types other than “Pages” press on
    }
    else
    {
    $postfooter = ‘<div>’;
    if ( is_single() )
    {
    $postfooter .= get_the_tag_list();
    
    // Display edit link
    if (current_user_can(‘edit_posts’))
    {
    $postfooter .= ‘ ‘ . thematic_postfooter_posteditlink();
    }
    }
    $postfooter .= “\n\n\t\t\t\t\t</div><!– .entry-utility –>\n”;
    
    }
    // Put it on the screen
    echo apply_filters( ‘thematic_postfooter’, $postfooter ); // Filter to override default post footer
    }
    
    

    shenanigans
    Participant

    Hey helgatheviking,

    thanks for your reply. Sorry for the messy code. I had to edit my post, and didn’t realize that it also messed up the code.

    I’ll post it again just below… You write, that both my calls are in IF-statements that address admin members only. So does the middle part

    
    elseif ( $post_type == ‘page’ )
    
    

    …also include admin only access? I thought it would be triggered, if a post is requested by a non-admin?

    Here’s my code again:

    
    function childtheme_override_postfooter() {
    
    $post_type = get_post_type();
    $post_type_obj = get_post_type_object($post_type);
    
    // Check for “Page” post-type and logged in user to show edit link
    if ( $post_type == ‘page’ && current_user_can(‘edit_posts’) )
    {
    $postfooter = ‘<div class=”entry-utility”>’ . thematic_postfooter_posteditlink();
    $postfooter .= get_the_tag_list();
    $postfooter .= “</div><!– .entry-utility –>\n”;
    // Display nothing for logged out users on a “Page” post-type
    }
    elseif ( $post_type == ‘page’ )
    {
    $postfooter .= ‘<div class=”entry-utility”>’;
    $postfooter .= get_the_tag_list();
    $postfooter .= “</div><!– .entry-utility –>\n”;
    // For post-types other than “Pages” press on
    }
    else
    {
    $postfooter = ‘<div class=”entry-utility”>’;
    // Display edit link
    if (current_user_can(‘edit_posts’))
    {
    $postfooter .= ‘ ‘ . thematic_postfooter_posteditlink();
    $postfooter .= get_the_tag_list();
    }
    $postfooter .= “\n\n\t\t\t\t\t</div><!– .entry-utility –>\n”;
    }
    // Put it on the screen
    echo apply_filters( ‘thematic_postfooter’, $postfooter ); // Filter to override default post footer
    }
    
    

    shenanigans
    Participant

    Just to clarify, because after reading what I wrote, I don’t even understand any longer what I was trying to explain 😉

    In a plain .html file it would look something like this:

    
    <div id=”header”>
    <div id=”header_bg_bar”>
    <div id=”branding”>
    …and div-classes…
    </div>
    <div id=”access”>
    …and div-classes…
    </div>
    </div>
    </div>
    
    
    in reply to: Removing meta data from excerpts #1222

    shenanigans
    Participant

    Wow, that worked like a charm, thanks very much! I don’t wanna get greedy, but would it also be possible to ban postmeta just from the excerpts? Are all posts and written content defined by the variable $post? If so, that would probably mean that I have to define a new variable for complete posts I guess?

Viewing 13 posts - 1 through 13 (of 13 total)