WordPress.org

Ready to get started?Download WordPress

Forums

Sampression Lite
adding post title to page title? (5 posts)

  1. Liz
    Member
    Posted 1 year ago #

    I love this theme, and have only one thing I'm struggling with. I'd like to be able to add my blog post title to the page title, so that when sharing the post to Facebook it shows up as "Blog Name | Post Title" rather than just "Blog Name". Is there a straightforward way to do this? I've poked around a bit in the templates and functions and haven't been able to easily identify where I'd need to make this change.

    Any suggestions or pointers would be welcome!

  2. dharmapoudel
    Member
    Posted 1 year ago #

    Hi Liz,
    You have to add some Facebook specific metas. For example

    <meta property="og:title" content="The latest Load Shedding Schedule:" />
    <meta property="og:url" content="http://battigayo.server295.com/schedule.php" />
    <meta name="og:description" content="Get the list of load shedding schedule in Nepal online and download or bookmark according to your preferences.">
    <meta property="og:image" content="http://battigayo.com/images/logo.jpg" />
    <meta property="og:site_name" content="http://www.battigayo.com" />

    Just place them before

    <!-- Charset -->
    	<meta charset="<?php bloginfo('charset'); ?>">

    after

    function sampression_add_meta() {
    	?>

    on your functions.php file on wp-content/themes/sampression-lite/includes/ directory.

    And let me know if this helps.

    Thanks

  3. Liz
    Member
    Posted 1 year ago #

    Thanks! I can do that in order to fix the sharing to Facebook, but it won't change the actual page title that's being generated for things like bookmarks. I'd really like to have the title tag include the full post name if at all possible.

  4. patshi
    Member
    Posted 1 year ago #

    just put

    <title><?php the_title(); ?></title>

    after the <head> tag and you have the title where it belongs.

    Patrick.

  5. omgb
    Member
    Posted 11 months ago #

    if you put this in the header.php your index.php has a title of your last post...
    is there a way around it?

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic