• Hi there

    I have made my own custom post type, where MSLS connects nicely, so I can create a relationship between 2 posts.

    However, I cannot figure out how to display my custom post type on the public site.

    Is it possible I can see an example.

    // Allan

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Dennis Ploetner

    (@realloc)

    You should be able to see an icon whenever you write a post (or other type of content) like in my example here: https://imgur.com/a/3Ck7ZPe

    Thread Starter djalfe

    (@djalfe)

    Hello Dennis
    It is me who is not clear enough with what I am asking for.

    I would like to retrieve data from my custom post type programmatically
    I have played a bit with msls_get_post(int id), as it is the only one I have found that gives me relations for my custom type post.

    <?php

    $msls_blog = msls_get_post([postid]);
    print_r($msls_blog);

    ?>

    Think there is definitely a proper way to retrieve my post type, in current language.
    Meaby there is a way with a hook or some kind ??

    Thanks
    // Allan

    develobaby

    (@bornefysioterapi)

    Hey Allan,

    Isn’t this pinned thread exactly what you are looking for?
    https://wordpress.org/support/topic/get-the-related-page-id/

    Best,
    Maria

    Thread Starter djalfe

    (@djalfe)

    Hi Dennis It’s not quite what I’m looking for, unfortunately.

    I have created a custom post type I call “Resources”.
    I use it to store Static content, such as Footer, script connection for e.g. google maps or embedded third party products.

    Using MSLS, my thought was to retrieve e.g. footer into theme part “parts/footer.php” on my theme.

    My thought was to be able to query MSLS for related IDs or post content in current language, based on ID or slug.

    Does it make sense?

    Plugin Author Dennis Ploetner

    (@realloc)

    I guess that your code has a small flaw. The expected input for that function is an integer not an array:

    <?php

    $post_id = get_queried_object_id(); // or any number of your choice
    $msls_post = msls_get_post( $post_id );
    print_r( $msls_post );
    Thread Starter djalfe

    (@djalfe)

    Hi there
    sorry about the long response, Christmas has taking my time 🙂

    I finally got around to trying out msls_get_post(id), which gives me opposite IDs of the language I’m in.
    I need id or WPPost content for current language.

    I currently have 2 languages, Danish and English. Here I have created 2 Footer custom post Type, related to each other

    Footer [en-UK] => id:33
    Footer [da-DK] => id:126

    For example, when I request msls for id in current language, based on my record id:33. Then I would like to receive relationsid or WPPost to be able to insert content from the Footer that fits the current language.

    MSLS get based on id:33
    if (output for id:33 do NOT have same language as current language)
    { find relations to id:33 and output with same as current language like id:126 if danish }
    else
    { output id:33 }

    Does that make sense??

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

The topic ‘msls with custom post type’ is closed to new replies.