WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
Title Tag merged String (21 posts)

  1. Shonu
    Member
    Posted 3 years ago #

    My page title at the events page reads


    <title>EventsAstronomy Club</title>

    Why is the text merged without space or hyphen ? What have I configured wrong. I checked the placeholder page and the EM config and could not find the setting (overlooked?)

    Thanks

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    maybe your theme. using something like yoast seo or all in one seo should allow you to modify that (or you can mod the header.php file in your theme)

  3. Shonu
    Member
    Posted 3 years ago #

    Using WP default theme. Any why only the events page ?
    All others have
    <Page title> | Astronomy Club

    hmmmm

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    will check and see if this happens to me (no other complaints, so assumed it's limited to you)

  5. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    btw, i checked this, you're right. however, the solution is to add a " | " to your events title and other page titles in your events > settings page.

    a bit laborious, i know, but the most flexible way for all

  6. Shonu
    Member
    Posted 3 years ago #

    ..fixes the Browser title but also shows on my page top as
    "Events | "

    Guess I need to sit it out until fixed.

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    oops, good pt

  8. Blazing Torch
    Member
    Posted 3 years ago #

    same problem here, event titles are all bunched up...

  9. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    am looking into this further

  10. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 3 years ago #

    I would rather not play with this due to other changes I'll be making soon (and other reasons, e.g. it works with SEO plugins), so for now you can just add this to your wordpress files (e.g. in your theme functions.php file).

    function em_content_page_title_rewrite($content) { return $content . " | "; }
    add_filter ( 'em_content_page_title', 'em_content_page_title_rewrite',10,1 );
  11. Shonu
    Member
    Posted 3 years ago #

    Still keeps my page title inline with the additional separator. In the end there must be an ugly conditional on this plugin. But for now I will keep a space instead of a |. At least the words are separated in the Boommark and the space is invisible on the page

  12. primatology
    Member
    Posted 2 years ago #

    Figured it out. Navigate to the following url: http://yourwordpresssite.com/wp-admin/plugin-editor.php?file=events-manager/em-events.php&a=te&scrollto=2467

    The top two lines should look like this:

    //add_filter ( 'single_post_title', 'em_content_page_title',1,1 ); //Filter for the wp_title of page, can directly reference page title function
    add_filter ( 'wp_title', 'em_content_page_title',10,1 );

    Change that second line to the following:
    add_filter ( 'the_title', 'em_content_page_title',10,1 );

    Looks like Marvin was just using the wrong filter :-/

  13. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    tried that before, problem is whilst it fixes the issue on some themes, it ruins the ones that worked before. if it works for you though, then great! might be worth adding that to your functions.php file instead, e.g.

    add_filter ( 'the_title', 'em_content_page_title',10,1 );
    remove_filter ( 'wp_title', 'em_content_page_title',10,1 );
  14. magicroundabout
    Member
    Posted 2 years ago #

    Aha - found this after creating a new topic at: http://wordpress.org/support/topic/plugin-events-manager-events-manager-wipes-out-wp_title

    I don't know what else Marcus has in the pipeline that might change this, but the fact is that having the EM filter on the wp_title hook interferes with the correct operation of the wp_title function.

    wp_title is documented here: http://codex.wordpress.org/Function_Reference/wp_title and it takes two parameters related to a separator.

    If I call:

    wp_title( '|', true, 'right' )

    then I should get back:

    <Title> |'

    The filter in EM hooks to the wp_title hook, which is right at the end of the wp_title() function. The EM filter takes the wp_title() output and spits out some new output. HOWEVER...it ignores the separator parameters.

    I would therefore argue that if you're hooking to the wp_title filter hook then your filter needs to observe the separator parameters to preserve the correct functionality of the wp_title() function.

    The alternative is to hook the filter in elsewhere. I, personally, think that hooking into the_title and preserving the functionality of wp_title() is the right thing to do, but Marcus is the developer and he knows what's up his sleeve.

  15. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    played around a lot with that months ago, and not really keen to play more since changing events to posts will solve this

  16. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    btw, I use all in one SEO and it formats our titles etc. very well (i believe yoast's one works this way too)

  17. magicroundabout
    Member
    Posted 2 years ago #

    Oh, and, actually, hooking the filter to the_title isn't right either. It will replace all titles on an event page with whatever the filter produces.

    For me this turns my nav menu into:

    Events - Events - Events - Events - Events

    Hooking the filter to the 'single_post_title' hook seems like a better idea. Put this in your functions instead:

    add_filter ( 'single_post_title', 'em_content_page_title',10,1 );
    remove_filter ( 'wp_title', 'em_content_page_title',10,1 );
  18. magicroundabout
    Member
    Posted 2 years ago #

    Ah, OK. Changing events to posts seems like a really good move (though a lot of work!). Then you don't need the filter at all, right? :)

  19. Shonu
    Member
    Posted 2 years ago #

    changing events to posts will solve this

    May I ask carefully, how I can do that ?
    Reading this I am getting a bit confused.

    Thanks

  20. magicroundabout
    Member
    Posted 2 years ago #

    Shonu, Marcus is rewriting the Events Manager plugin so that it will use what's called a "custom post type".

    This will mean that events will just be a type of post within WordPress.

    This change will happen in a future version of the plugin.

  21. Shonu
    Member
    Posted 2 years ago #

    I see. Thanks for clarifying.
    I assume the post would be containing all the properties ("Attributes") that a current event handles (everything around the content of the event, Start, end date, Location, etc.)
    If such a post type will have templates as current events have, then this sounds good.
    Sounds like a 5.0 version ...

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic