Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum content in meta and topic title in title?

  • @tubruk

    Participant

    Hello
    how can I show the topic title in title> /title> and a small part of the forum content in <meta description </meta??

    sorry for my poor english

Viewing 17 replies - 1 through 17 (of 17 total)
  • @tubruk

    Participant

    no one is interested in seo??

    @finni3

    Participant

    @tubruk

    Participant

    yeah but I want to solve it without a plugin I’m sure that there is a function I’ve tried some it didnt work…

    @rogercoathup

    Participant

    You need to look at the following:

    https://codex.wordpress.org/Meta_Tags_in_WordPress
    and the file bp-forums-templatetags.php in the bp-forums folder

    You can then build your forum SEO tags, just the way you want, in your theme’s header.php file

    @tubruk

    Participant

    @RogerCoathup thanks for help

    I do have a file called bp-forums-templatetags.php in the bp forums folder?

    I tried this here :
    bp_get_the_topic_title() ?
    it didnt worked???

    @rogercoathup

    Participant

    You need to ask your question clearly and provide more information.

    Where did you try the function call?

    Use pastebin.com and post your code.

    @tubruk

    Participant

    I’m using a child theme and I added this between title /title in header.php

    @hnla

    Participant

    You would need bp_the_topic_title() that function echos the result of bp_get_the_topic_title()

    @rogercoathup

    Participant

    ok, I suspect that bp_get_the_topic_title() and the forum template tags can only be used inside the loop. Can anyone confirm this?

    Instead, have a look at the functions in bp-forums.php and see if they will help you.

    Alternatively, download the plugins that @modemlooper advised, and have a look at their code to see which functions they used

    @rogercoathup

    Participant

    You can also look at the functions in bp-forums/bbpress/bb-includes/functions.bb-topics.php

    Unless anyone else knows a quicker way, you are going to have to get your hands dirty coding this one.

    Personally, I’d leave it until the new forums plugin comes out in beta in mid September.

    @tubruk

    Participant

    thanks will try something

    about which new forum plugin are you speaking?

    @rogercoathup

    Participant

    http://wpmu.org/big-news-for-bbpress-users-a-bbpress-plugin-is-coming-to-wordpress/

    p.s. if it just needs you to use the echo-ing version of the function: bp_the_topic_title() as suggested by @hnla, then please report back on this thread, so that we have the information.

    I assumed you would have been trying to echo the result anyway. Please post all your relevant code in future

    @hnla

    Participant

    seem to only run within the loops which sounds right, can’t find a quick, easy means of passing it out.

    @tubruk

    Participant

    so no solution for now?

    @r-a-y

    Keymaster

    @hnla

    Participant

    I think though a ticket needs submitting? perhaps an enhancement? the title tag needs to be a little more intelligent, perhaps it’s gone unnoticed but browser bookmark titles are often taken from title tag.

    @r-a-y

    Keymaster

    Yes, a ticket does need to be created for this!

    *Edit – ticket created:
    https://trac.buddypress.org/ticket/2598

    To have the topic content as meta description for forum threads, add the following to your theme’s functions.php file:
    http://pastebin.com/w0rY2bnd

Viewing 17 replies - 1 through 17 (of 17 total)
  • The topic ‘Forum content in meta and topic title in title?’ is closed to new replies.
Skip to toolbar