Support » Fixing WordPress » get_bookmarks by parent title is being interupted by an Apostrophe in the title

  • Hello,

    I am trying to get a list of bookmarks categorized with the title of the page’s parent page.

    I have been using the follwing code and everything has been working well so far:

    <?php
    wp_list_bookmarks('&order=DESC&orderby=id&title_li=&categorize=0&category_name='.$parent_title = get_the_title($post->post_parent).'&before=&after=<br />');
    ?>
    </div>

    Recently I have added a new Parent page with an apostrophe in the title and the function will not work.

    What I am trying to do is get a list of boomarks tagged with the title of the parent of the page I am trying to list the bookmarks.

    For example on this page (http://jessicasilvermangallery.com/ruairiadh-oconnell/press/) the child is “Press”, the parent is “Ruairiadh O’Connel”

    I wan’t to list all bookmarks that have that tag “Ruairiadh O’Connel”.

    Is there a way to ignore or sanitize the apostrophe? Or perhaps an alternate code that gets the bookmark by the category slug rather than the title?

    Thank you

  • The topic ‘get_bookmarks by parent title is being interupted by an Apostrophe in the title’ is closed to new replies.