postcomments and posttags on theme Responsive Base

Home Forums Using Thematic Child Themes Free and Premium Child Themes postcomments and posttags on theme Responsive Base

This topic is: resolved

This topic contains 17 replies, has 5 voices, and was last updated by  helgatheviking 5 years, 4 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #427

    soreno
    Participant

    This is my goal!

    I have moved the entrydate and postcomment to be over the title with this code:

    function remove_access() {
    remove_action('thematic_header', 'thematic_access', 9);
    }
    add_action('init', 'remove_access');
    // add menu to its new position
    add_action('thematic_header', 'thematic_access', 0);

    function meta_split_title($thepostheader) {
    global $post;
    if(is_page() || is_404()){
    $thepostheader = thematic_postheader_posttitle();
    } else {
    $thepostheader = thematic_postmeta_entrydate() .thematic_postfooter_postcomments();
    $thepostheader .= thematic_postheader_posttitle() . thematic_postmeta_authorlink();
    }
    return $thepostheader;
    }
    add_filter('thematic_postheader', 'meta_split_title');

    Next is to keep the tags only on the homepage and not on singlepage I use this code:


    function kia_filter_postfooter($postfooter){
    if(is_home()) {
    $postfooter = thematic_postfooter_posttags();
    }
    return $postfooter;
    }
    add_filter('thematic_postfooter','kia_filter_postfooter');

    Now comes the problem…

    How do I remove the posttags, postcomments from the bottom of the singlepage?
    I want the div entry-utility to be empty but still have the postcomments on top!
    If I try the below code I remove all except postcomment, but then postcomments show up both above the title and at the bottom…


    function kia_filter_postfooter2($postfooter){
    if(is_single()) {
    $postfooter = thematic_postfooter_postcomments();
    }
    return $postfooter;
    }
    add_filter('thematic_postfooter','kia_filter_postfooter2');

    #434

    soreno
    Participant

    hmmm I sem to have put this posts on wrong topic… sorry,
    anyway I been working on it but still not there yet. I have moved the postcomments and entrydate to the top (above the entrytitle) and I got the posttag at the bottom on home, single and archive pages. But on single and archive pages the posttag seems to be on two lines where on the second line is a litte dot (period). Is there a way to remove second row with this “strange” dot? Look at this image Tag with dot
    This is what I have in function.php


    // get entrydate and postcomments above entrytitle //
    function meta_split_title($thepostheader) {
    global $post;
    if(is_page() || is_404()){
    $thepostheader = thematic_postheader_posttitle();
    } else {
    $thepostheader = thematic_postmeta_entrydate() .thematic_postfooter_postcomments();
    $thepostheader .= thematic_postheader_posttitle() . thematic_postmeta_authorlink();
    }
    return $thepostheader;
    }
    add_filter('thematic_postheader', 'meta_split_title');

    // add tags to homepage, singlepage and archivepage //
    function kia_filter_postfooter($postfooter){
    if(is_home() || is_single() || is_archive()) {
    $postfooter = thematic_postfooter_posttags();
    }
    return $postfooter;
    }
    add_filter('thematic_postfooter','kia_filter_postfooter');

    #442

    helgatheviking
    Moderator

    getting a 403 on your image.  what do you want in the footer?  under what conditions?

    is is possible that the dot is coming from thematic_postfooter_posttags().  take a look at that function and see if it is the source of the problem.  there is almost assuredly a filter in it that you can use to adjust it.

    sorry i can’t help more right now, my computer is dead!

    #444

    soreno
    Participant

    I want the posttags to show in the footer nothing else, and the filter works but it also gives me a second row (on singlepage) that starts with a period. I run thru the functions.php and disable one at the time to see if there was an interference with others, but no, the dot is still there annoying me. Looks like this on singlepage footer

    and tagged Tag1, Tag2, Tag3, etc
    .

    and in firebug it shows me this

    span class=”tag-links”
    .

    The dot only shows up when I have singlepage, not on homepage or on archivepage

    #449

    soreno
    Participant

    The sample can be seen here…
    http://www.digitalworkflow.se/test/

    #451

    middlesister
    Keymaster

    I had to take a look at the source code to find this. There is indeed a dot at the end, outside the span. This is because the posttags function is constructed to be part of a sentence. The dot is the end of that sentence.

    What I guess from the screenshots is that you are styling the “tag-links” span with a float:right and/or display:block. That would cause the dot to jump down and start a new paragraph. As I see it you have two options:

    one – float the whole entry-utility right and not only the “tag-links” span. Text-align:right would also work. The dot will remain but be part of the same line, ending the sentence.

    two – use a filter on  thematic_postfooter_posttags to remove the dot from the markup completely.

    #452

    soreno
    Participant

    middlesister,
    Yes I did style the tag-link span with display:block and float:right
    The first option does not work for me, entry-utility does not react to styling, nothing happen when using float or text-align…

    How would such a filter look like to filter out the dot?

    Thanks
    Soren

    #453

    newb
    Participant

    This?

    `

    function childtheme_thematic_postfooter_posttags($posttags) {
    if ( is_single() && !is_object_in_taxonomy( get_post_type(), ‘category’ ) ) {
    $tagtext = __(‘ This entry is tagged’, ‘thematic’);
    $posttags = get_the_tag_list(“<span class=\”tag-links\”> $tagtext “,’, ‘,'</span>.HERE IS THE PERIOD ‘);
    } elseif ( is_single() ) {
    $tagtext = __(‘ and tagged’, ‘thematic’);
    $posttags = get_the_tag_list(“<span class=\”tag-links\”> $tagtext “,’, ‘,'</span>.HERE IS ANOTHER PERIOD ‘);
    }
    return $posttags;
    }
    add_filter(‘thematic_postfooter_posttags’, ‘childtheme_thematic_postfooter_posttags’);

    `

    #454

    newb
    Participant

    Also, the “HERE IS THE PERIOD”  shows where the period is, however because the way it works, there are two different parts, one for with categories, one without.

    #455

    middlesister
    Keymaster

    Something like


    function midsis_filter_posttags($postfooter){
    if ( is_single() ) {
    $tagtext = __(' This entry is tagged', 'thematic');
    $posttags = get_the_tag_list(" $tagtext ",', ','');
    }
    return $posttags;
    }
    add_filter('thematic_postfooter_posttags','midsis_filter_posttags');

    I noticed you did not show any categories, so this would show the same text on single pages as on archives and homepage i.e. “This entry is tagged “, avoiding the “and tagged…” bit.

    #456

    soreno
    Participant

    that was not an easy one newb… 😉

    unfortunately it gives me blank screen so something is wrong…

    #457

    soreno
    Participant

    middlesister,

    I lost the tags both from homepage and archivepage. On singlepage the tags are there but I prefer the word “Tagged” to save space and clutter… It also turn to an “a” tag in content so I lost the style for “tag-links”

    My idea seem to be harder than I thought…

    It seems to broke this function..

    // add tags to homepage
    function kia_filter_postfooter($postfooter){
    if(is_home() || is_single() || is_archive()) {
    $postfooter = thematic_postfooter_posttags();
    }
    return $postfooter;
    }
    add_filter('thematic_postfooter','kia_filter_postfooter');

    #458

    middlesister
    Keymaster

    Sorry I miss-spelt a variable. We have to return the unchanged $posttags when we don’t want to change it. Try this


    function midsis_filter_posttags($posttags){
    if ( is_single() ) {
    $tagtext = __('Tagged', 'thematic');
    $posttags = get_the_tag_list("<span class=\"tag-links\"> $tagtext ",', ','</span>');
    }
    return $posttags;
    }
    add_filter('thematic_postfooter_posttags','midsis_filter_posttags');
    }

    #459

    soreno
    Participant

    sorry….
    gives me a blank screen….

    thanks for all help

    #462

    Gene (emhr)
    Keymaster

    Soreno,

    Middlesister’s code will work better if you omit the final `}` That is likely causing a parse error ( white screen )

    Try:
    ` function midsis_filter_posttags($posttags){
    if ( is_single() ) {
    $tagtext = __(‘Tagged’, ‘thematic’);
    $posttags = get_the_tag_list(” $tagtext “,’, ‘,”);
    }
    return $posttags;
    }
    add_filter(‘thematic_postfooter_posttags’,’midsis_filter_posttags’);
    `

    It would probably be wise to validate the php snippets given on these forum before you use them or learn how to debug or turn on error logging or reporting. We all make mistakes 😉

Viewing 15 posts - 1 through 15 (of 18 total)

The topic ‘postcomments and posttags on theme Responsive Base’ is closed to new replies.