WordPress.org

Ready to get started?Download WordPress

Forums

Remove Author and Date in Pages only in Elbee Elgee theme (36 posts)

  1. CEgos
    Member
    Posted 2 years ago #

    Bit of a newbee here.

    I've searched WP settings to change and theme php files for code snippets others cited in the forums regarding author, date, comment removal/hiding in themes.

    I have Elbee Elgee theme. I was only able to disable comments by changing the page.php file.

    I can't remove author and date.

    I looked in loop files, index, etc. I don't recognize anything familiar.

    I want to only remove author & date in pages.

    Can someone pls help?

  2. CEgos
    Member
    Posted 2 years ago #

    bump
    sorry, really need help

  3. Doug
    Member
    Posted 2 years ago #

    CEgos:
    You want to disable those for all posts, pages, etc., or only JUST pages?

    I just posted this in one of the other threads, but the answer is in my FAQ for Elbee Elgee.

    Q: “How can I remove the ‘Posted by admin on (date) edit this entry’ ? I don’t want that to show on my page.”

    A:

    Make sure you're using a child theme (see above).
    Edit your child theme's functions.php
    Add this to the bottom of functions.php:

    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );

    Hope this helps!

  4. gravy
    Member
    Posted 2 years ago #

    I am having the same problem... what is a child theme in Elbee Elgee? I am also having some issues finding the "functions.php" I tried to add the line at the end of your post to the "edit" section on the pages, but it didn't do anything... any advice?

  5. Doug
    Member
    Posted 2 years ago #

    gravy:

    1. Grab this child theme: https://bitbucket.org/zamoose/elbee-elgee/downloads/elbee-child-1.1.zip
    2. Unzip it in your wp-content/themes/ directory.
    3. Activate the child theme.
    4. Add the lines I specified above to wp-content/themes/elbee-child/functions.php
    5. Profit!
  6. tokshra
    Member
    Posted 2 years ago #

    I have done all this...downloaded the child theme
    installed and activated
    added the line to the functions.php

    The author date and name are still there!

    How do you REALLY get rid of this? Give me the code to change in the editor...I am very familiar with the editor.

    Also, after adding the code, the line of code appears at the top of the page! You can see it here: http://www.sarcoidosisonline.com

  7. Doug
    Member
    Posted 2 years ago #

    tokshra:
    That looks like you may have pasted the code outside of the PHP tags. If all you added was that line, your functions.php should look like the contents of this Gist:

    https://gist.github.com/1964125

    Try grabbing that code and replacing the contents of wp-content/themes/elbee-child/functions.php with it.

  8. tokshra
    Member
    Posted 2 years ago #

    there was only one line in functions:
    <?php

    now there are 2:

    <?php
    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );

    so, where does the line go then?

  9. tokshra
    Member
    Posted 2 years ago #

    I copied and pasted just as shown...still no difference?

  10. Doug
    Member
    Posted 2 years ago #

    tokshra:
    I'm not sure I follow your question. The entire contents of functions.php should be the two lines I specified. That is to say, you should have those two lines and nothing else...

  11. Doug
    Member
    Posted 2 years ago #

    tokshra:
    Did you add the remove_action() line to wp-content/themes/elbee-child/functions.php or did you add it to wp-content/themes/elbee-elgee/functions.php or did you add it to both?

    It should NOT be added to the parent Elbee Elgee install's functions.php.

  12. tokshra
    Member
    Posted 2 years ago #

    yes, I had put it in the main theme...I have now deleted that.

    I have the 2 lines in child function.php just as you showed...the author and date are still showing?

  13. tokshra
    Member
    Posted 2 years ago #

    I really like this theme, but I would like to have the dates removed..it appears the author has disappeared, so it partly worked

    thanks for your input

  14. Doug
    Member
    Posted 2 years ago #

    [/Facepalm]

    Of course it's not going to work -- you've got to hook it on init! I am so sorry -- I gave you incomplete information.

    Try the following:

    function lbc_unplug_lblg_post_info(){
    	remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    	add_action( 'lblg_after_itemtext', 'lbc_post_info' );
    }
    add_action( 'init', 'lbc_unplug_lblg_post_info');
    
    function lbc_post_info(){
    	if( !is_page() ) { ?>
    	<span class="postcats">Posted in <?php the_category(', '); ?></span>
    	<?php } ?>
    	<?php if( is_single() ){?>
    	<span class="posttags"><?php the_tags('Tagged as: ',','); ?></span>
    	<?php }
    }

    Let me know if that works for you.

  15. tokshra
    Member
    Posted 2 years ago #

    That completely broke my site...this is what shows up now:
    Parse error: syntax error, unexpected '}', expecting T_STRING or T_VARIABLE or '$' in /home/umarketi/public_html/sarcoidosisonline.com/wp-content/themes/elbee-child/functions.php on line 7

    How do I get it back?

  16. Doug
    Member
    Posted 2 years ago #

    Can you post the entirety of your functions.php so I can take a look?

  17. tokshra
    Member
    Posted 2 years ago #

    <?php

    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    function npat_unplug_lblg_post_info(){
    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    add_action( 'lblg_after_itemtext', 'lbc_post_info' );
    }
    add_action( 'init', 'npat_unplug_lblg_post_info');

    function lbc_post_info(){
    if( !is_page() ) { ?>
    <span class="postcats">Posted in <?php the_category(', '); ?></span>
    <?php } ?>
    <?php if( is_single() ){?>
    <span class="posttags"><?php the_tags('Tagged as: ',','); ?></span>
    <?php }
    }

  18. Doug
    Member
    Posted 2 years ago #

    Delete that first remove_action line, the one outside the function.

  19. tokshra
    Member
    Posted 2 years ago #

    now I get this error:
    Parse error: syntax error, unexpected '}' in /home/umarketi/public_html/sarcoidosisonline.com/wp-content/themes/elbee-child/functions.php on line 9

  20. tokshra
    Member
    Posted 2 years ago #

    Now I am getting
    Parse error: syntax error, unexpected '}' in /home/umarketi/public_html/sarcoidosisonline.com/wp-content/themes/elbee-child/functions.php on line 10

    with this function:
    function lbc_unplug_lblg_post_info(){
    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    add_action( 'lblg_after_itemtext', 'lbc_post_info' );
    }
    add_action( 'init', 'lbc_unplug_lblg_post_info');

    function lbc_post_info(){
    if( !is_page() ) { ?>
    <span class="postcats">Posted in <?php the_category(', '); ?></span>
    <?php } ?>
    <?php if( is_single() ){?>
    <span class="posttags"><?php the_tags('Tagged as: ',','); ?></span>
    <?php }
    }

  21. tokshra
    Member
    Posted 2 years ago #

    Never mind...I had left off the <?php
    it is OK now!

    WHEW!!!

  22. Doug
    Member
    Posted 2 years ago #

    Good to know. Thanks for updating me.

  23. Pistolpier
    Member
    Posted 2 years ago #

    Hi ZaMoose, I have just tried to do what you mentioned above and I now have the following error.
    "Parse error: syntax error, unexpected $end in /home/macli925/public_html/wp-content/themes/elbee-child/functions.php on line 2.

    Any cannot get back to my site to change the info or delete what I did, whihc was entered the following info in the child theme.

    "remove_action( 'lblg_after_itemtext', 'lblg_post_info' ); "

    help!!!

  24. Pistolpier
    Member
    Posted 2 years ago #

    Dont worry I ended up deleting the Child theme and are going to leave it with the info at the bottom of the page

  25. gravy
    Member
    Posted 2 years ago #

    I uploaded the child theme you said on my godaddy host and cut and paste the lines from above and still was notable to get rid of the posted by and date on each page... I was able to do it before without uploading the chil theme you suggest and then the template was updated. Any suggestions on how I can really remove this stuff or locate thechild theme without uploading the one you gave us?

  26. Doug
    Member
    Posted 2 years ago #

    gravy:
    I'm not sure what you're asking. Could you try restating your question?

    Thanks.

  27. gravy
    Member
    Posted 2 years ago #

    I uploaded and activated the elbee child theme, activated it, went to the function.php tab and all there was is: <?php

    I then added: remove_action( 'lblg_after_itemtext', 'lblg_post_info' ); before and after it and it did not work... I also added: remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    function npat_unplug_lblg_post_info(){
    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    add_action( 'lblg_after_itemtext', 'lbc_post_info' );
    }
    add_action( 'init', 'npat_unplug_lblg_post_info');

    function lbc_post_info(){
    if( !is_page() ) { ?>
    <span class="postcats">Posted in <?php the_category(', '); ?></span>
    <?php } ?>
    <?php if( is_single() ){?>
    <span class="posttags"><?php the_tags('Tagged as: ',','); ?></span>
    <?php }
    }
    Before and after, and saved it and it still did not work... on the older version of elbee elgee you didn't have to do all of this... any suggestions on what's missing? everytime I follow your directions, it doesnt work on my site...

  28. Doug
    Member
    Posted 2 years ago #

    Gravy:
    Do you have a link to your site that I could take a look at by any chance?

  29. juliecoolgrl
    Member
    Posted 2 years ago #

    http://doasianfood.com

    I've got this error message and site does not functioning no more.
    Can you help me please..?

    Parse error: syntax error, unexpected $end in /home/kdub12/public_html/doasianfood.com/wp-content/themes/elbee-child/functions.php on line 14

    I added this after the first line <?php

    function npat_unplug_lblg_post_info(){
    remove_action( 'lblg_after_itemtext', 'lblg_post_info' );
    add_action( 'lblg_after_itemtext', 'lbc_post_info' );
    }
    add_action( 'init', 'npat_unplug_lblg_post_info');

    function lbc_post_info(){
    if( !is_page() ) { ?>
    <span class="postcats">Posted in <?php the_category(', '); ?></span>
    <?php } ?>
    <?php if( is_single() ){?>
    <span class="posttags"><?php the_tags('Tagged as: ',','); ?></span>

  30. Doug
    Member
    Posted 2 years ago #

    julie:
    Looks like you forgot a closing curly bracket. Add
    <?php } ?> after the closing span tag and see if that helps.

Topic Closed

This topic has been closed to new replies.

About this Topic