• Resolved Doodlebee

    (@doodlebee)


    I have an interesting question – I haven’t seen an answer to it yet. I need to search Pages as well as posts. I found two plugins for this – both work in pretty much the same way. That latter is an old hack put into plugin form.

    My problem is this: as long as my Page titles are one word, any of these solutions work just fine. However, if the Page title is more than one word, and permalinks are turned on, then it no longer functions. For example, if I have a Page titled “See this here”, then the permalink would be “see-this-here”. But the search hacks/plugins put in the character for spaces instead – “see%20this%20here”, and the search comes up incorrectly.

    Is there a way to make any of these force the search hack to use the slugs instead of the %20 thing? I can’t figure this out. I thought a preg_replace might work, but I’m having a code brainfart and can’t quite figure it out.

    (and BTW – yes, I’ve contacted the plugin authors – haven’t heard from them yet.)

    I’d appreciate any ideas! Thanks 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hmmm. Could you use one of the dashes-to-underscores plugins to help?

    Thread Starter Doodlebee

    (@doodlebee)

    I tried that – but it’s not doing anything. Probably because there’s no dashes…

    The thing is working fine – when I search for stuff (and stuff I *know* is only in a Page) then the search will find it. However, the link that comes up in the search results is the in the format where the spaces are represented by %20 *instead* of dashes (and the case is exact – if it’s typed in uppdercase letters, then the link shows it with uppercase letters, which also makes an erroneous link)

    However, other places I’m seeing this hack being used, they don’t seem to have this problem. Even multi-word titles are being shown as linking to a sinlge word – which I’m assuming is the slug – because it’s certainly not the title.

    So I guess I just need to know how to change the link title on the search results page to link to the slug instead of the post/Page title. Is there a way to do that?

    Well, gosh…. I’m confused. I thought that WAS how it was done.

    Thread Starter Doodlebee

    (@doodlebee)

    Yeah – everything I’m reading says it *should* be that way – and on the posts, it *is* reading the slug as the title and linking to it. But on the Pages, it’s literally linking ot the Page title – spaces and capital letters – everything. it’s not taking it down to the “all lowercase letters and spaces changed to dashes” thing. Even when I rename the slug to a single word, it ignores the slug utterly and goes right for the title.

    It’s very weird though – I see this working on other sites, so I wonder what I’m doing differently so that it’s not working on mine? Very odd.

    Thread Starter Doodlebee

    (@doodlebee)

    Argh!

    More dumb idiotic stupid stuff.

    I swear, I shouldn’t work this late.

    I had accidentally replaced <?php the_permalink(); ?> with <?php the_title(); ?>

    I need smacked, seriously. How many dumb mistakes can you make in a day? I mean, really.

    Oh honey – you do NOT want to know how many…. Glad it’s sorted!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Search Pages and Permalinks’ is closed to new replies.