Deleting Page Title on all pages
Topics related to Elif lite theme goes here.

Meriah

New Member Rank
Posts: 2
Joined: Tue Jan 30, 2018 8:15 pm
Display Name: Meriah

Deleting Page Title on all pages

linkPost by Meriah » Thu Feb 08, 2018 7:22 am

Hi there,
1. I would like to delete the automatic Page Titles that show up on the Elif Lite theme.
I'm not sure how to attach a picture of the titles I'm talking about, but for example, the words Home, Blog, About Us etc. show up at the top of the pages and I would like to have those not show on any of my pages

2. On a somewhat unrelated topic, I was wondering if there is a way to show the post excerpt when using the Themient: Recent Posts widget

3. I'd posted a topic previously that turned out to be not directly related to the Elif theme (my mistake!) but can't for the life of me figure out how to delete it! Feel free to delete it on your end if it's easier than explaining to me how to delete it.

Thanks so much for your help! I'm new to WP and it's so great to have this forum to get help when I come up with stupid questions! :lol:
User avatar
Asmi Khalil

Site Admin Rank
Posts: 724
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Deleting Page Title on all pages

linkPost by admin » Fri Feb 09, 2018 10:12 pm

Hi Meriah,
1. I would like to delete the automatic Page Titles that show up on the Elif Lite theme.
I'm not sure how to attach a picture of the titles I'm talking about, but for example, the words Home, Blog, About Us etc. show up at the top of the pages and I would like to have those not show on any of my pages
The easy way is to simply hide the page title on specific pages using the below CSS code;
.page-id-79 .single-header, .page-id-80 .single-header {
    display: none;
}
But this will require you to know those pages IDs that you want to hide their titles. The page ID is always visible in the link to the page editor in your admin dashboard. Simply go to Pages => All Pages. Now mouseover any page and you will see at the end of your URL something like this "http://example.com/wp-admin/post.php?post=80&action=edit". In this case your page ID is 80.
Now go back to the above CSS code and change .page-id-XX with .page-id-80.
For multiple pages, simply separate the CSS classes with comma like: .page-id-51 .single-header, .page-id-2055 .single-header, .page-id-6489 .single-header ..etc.

But a better solution would be to have a meta box with a tiny checkbox in the post editor. When this checkbox is checked, the page title will not be displayed. But such solution will require editing template files and write a code to register the meta box, the checkbox option and a callback to handle saving the option which is beyond the scope of our support.
2. On a somewhat unrelated topic, I was wondering if there is a way to show the post excerpt when using the Themient: Recent Posts widget
You can add the excerpt by simply adding this code;
<p><?php echo elif_truncate_string( get_the_excerpt(), 8, 'words' ); ?></p>
At the end of this code (add a new line);
<h4 class="title"><a rel="nofollow" href="<?php the_permalink()?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h4>
<?php if ( $date == 1 || $comments == 1 ) { ?>
    <div class="post-meta">
        <?php if ( $date == 1 ) { ?>
            <span class="post-date"><i class="fa fa-clock-o" aria-hidden="true"></i><?php the_time( get_option( 'date_format' ) ); ?></span>
        <?php } ?>
        <?php if ( $comments == 1 ) { ?>
            <span class="post-comments"><i class="fa fa-comments" aria-hidden="true"></i><?php comments_number( '0', '1', '%' ); ?></span>
        <?php } ?>
    </div>
<?php } ?>
Inside /functions/widget-recentposts.php file.
It is better to use a child theme instead of editing theme files directly https://www.smashingmagazine.com/2016/0 ... ild-theme/ (use Elif Lite Child as Theme Name and elif-lite as Template.
3. I'd posted a topic previously that turned out to be not directly related to the Elif theme (my mistake!) but can't for the life of me figure out how to delete it! Feel free to delete it on your end if it's easier than explaining to me how to delete it.
Thanks for letting me know! I have deleted it.
Thanks so much for your help! I'm new to WP and it's so great to have this forum to get help when I come up with stupid questions! :lol:
Most welcome! Please don't hesitate to reach us for help. Don't forget that we all started somewhere :D
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943
Meriah

New Member Rank
Posts: 2
Joined: Tue Jan 30, 2018 8:15 pm
Display Name: Meriah

Re: Deleting Page Title on all pages

linkPost by Meriah » Mon Feb 12, 2018 4:08 pm

Thanks so much for getting back to me so quickly as always, you're the best!
So, when I looked for the page ID, what I saw (including for the static homepage) is a POST ID# rather than PAGE ID#. I tried what you'd explained, but swapping the word page to the word post but I didn't have any luck. Mind you, I haven't the foggiest idea what I'm doing when it comes to CSS soooo I'm not really surprised :D
Lucky for me, (and anyone else who has this problem) I found a plugin called "Title Remover" which worked like a charm and seems to have done what you were trying to explain about adding a checkbox to hide or not hide Page/Post titles! so.. YAY! My problem is solved!
Thank you for taking the time to help me yet again, I'm sure this won't be the last you guys hear from me in my slow but steady attempt to build a functioning website :lol:
Have a great day!
User avatar
Asmi Khalil

Site Admin Rank
Posts: 724
Joined: Fri Jun 26, 2015 7:13 am
Display Name: Asmi Khalil
Location: Tunisia

Re: Deleting Page Title on all pages

linkPost by admin » Fri Feb 23, 2018 1:32 am

Hi again,
Sorry for being late to reply this time but I am extremely busy redesigning Themient.com :oops:
Anyway, I am glad to hear that you have fixed the issue with a simple plugin. This far better and future proof that editing template files or adding CSS code.

If you need help I will be happy to assist you again :D
I think there is a world market for maybe five computers. - IBM chairman Thomas Watson, 1943

Who is online

Users browsing this forum: No registered users and 1 guest

It is currently Sat May 26, 2018 10:13 am