Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter TheJer

    (@thejer)

    Still trying to figure out a way to work with this. I messed around in the wp_posts table, but with no luck. It didn’t seem like any of the menus were actually all linked together and easy to manage.

    I’m guessing I might be out of luck on this?

    Thread Starter TheJer

    (@thejer)

    Well I got it figured out. I’m hoping that simple regular expressions wont slow down the site in the long run. I’m not entirely sure why, but calling the_title_attribute would not return what I wanted. So I ended up using the_title and creating a little function called get_alt.

    function get_alt( $str ) {
    $pattern = '/alt=\'(.*?)\'/';
    preg_match($pattern, $str, $match);
    return $match[1];
    }

    $match looks like
    [0] => alt=’whateveryouwerelookingfor’
    [1] => whateveryouwerelookingfor

    My PHP/regex knowledge is somewhat limited, but I think its because I’m actually matching for the alt= part, but the saving whats in between the ” and that turns up in [1] spot in the array?

    Either way, problem solved!

    Thread Starter TheJer

    (@thejer)

    Previous was obviously the wrong word to use haha. I should have said ‘the premise is to make the alt text the same as what the page used to be called.’ Either way, thank you for the help. I had been using the_title to grab the name, but I’ll play around with that and see if I can figure it out.

    Thread Starter TheJer

    (@thejer)

    So I discovered you can find all the menu information in the wp_posts table, but I’ve barely used SQL, so it is a lot of info sitting in that database and I’m not really sure what everything means.

    Anyone have any pointers on what I could look for to find the custom menus? I’m sure if I knew what to look for, I could probably find it and figure it out.

    Thread Starter TheJer

    (@thejer)

    Yes I do understand what the alt text is supposed to be used for (unless it has somehow changed in the past few years?). I guess I just worded that badly because the image is the name of the page just in image form.

    Thread Starter TheJer

    (@thejer)

    Okay, the code is located here

    Hopefully something has worked with something like this before?

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