Show file path in live search

This support request was posted in General Support by kurtal

Request ID #7138 Resolved
  • Hi Juan,

    We have multiple pages with the same title, explaining how to complete the same action on different devices (iOS, Android, web, etc.). I’d like users to be able to find the appropriate page based on the site’s file pathway which organizes the pages by device, app, etc.

    Is it possible to show the file pathway for a page in live search?

    Thanks for your time!
    Kurt

    Ricardo Aiello

    Hi kurtal,

    Juan isn’t available today, so I’ll be helping you instead. Nice to meet you 🙂

    According to SEO standards, having multiple pages with the exact same title would not be a best practice. My best advice would be for you to consider adjusting that titles to include the device name, i.e.:

    • How to take a screenshot on iOS
    • How to take a screenshot on Android

    That said, here’s a code snippet you can use to achieve what you want. Note that the code for the `custom.css` file can also be placed in NiceThemes > Theme Options > Design & Styles > Custom CSS.

    Please let me know if this solves your issue, and if I can be of further assistance.

    Best,

    Ricardo

    Hi Ricardo,

    That’s great, and noted about SEO best practices.

    The code you sent me accomplishes what I asked for, but is there a way to clean up the file pathway? Use titlecase? Eliminate dashes?

    Here is what I have now: http://prntscr.com/bdj5it

    I’d like Troubleshoot to be ‘Mobile Apps/Herd Management for Android/Troubleshoot’ instead of /mobile-apps/herd-management-for-android/troubleshoot/

    Thanks in advance for your time!

    Kurt

    Ricardo Aiello

    Hi Kurt,

    The following part of the previous snippet obtains the file path, and it can be replaced with anything you want:
    str_replace( get_bloginfo( 'url' ), '', get_permalink( $id ) )

    To accomplish what you want properly, you would need to:
    – obtain the parent post or category IDs for the post with ID $id all the way to the top;
    – obtain the title of each post or category;
    – and construct the string.

    It’s pretty much what a breadcrumb does, except that you don’t need each title to be linked.

    Unfortunately, Flatbase’s breadcrumb functionality can’t be used out of the box in this case, and such a customization is beyond the reach of our support, so we won’t be able to assist you with a code snippet. You will need to write it yourself, or find a local developer to do it for you.

    Please let me know if I can be of further assistance.

    Best,

    Ricardo

    Hi Ricardo,

    Thanks for your informative response. We have resources on our team that should be able to make this happen.

    Thanks for your time.

    Kurt

    Ricardo Aiello

    Hi Kurt,

    My pleasure. Don’t hesitate to write again if there is anything else we can do for you.

    Best,

    Ricardo

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

This topic is marked as resolved

Only the topic author can re-open this thread.

Login to your Account

Welcome back! Please log in to your account by filling the fields below:

Forgot?

Not a member? Create a free account.

Create a Free Account

You're 27 seconds away from some awesome WordPress free stuff, benefits and more. Create a free account and have access to our free products, benefits and more!

Already have an account? Log in
Secure Server