Support » Plugin: A-Z Listing » Custom URL in list output only for one special category

  • Resolved Anita

    (@wpstube)


    Hi,
    I created a library via blog article and enthusiastically use your plugin for it. Works great. Thank you for that!

    Now I have additionally a download manager in use and would like to output on a page the available downloads also with A-Z, so that the optics remain the same for my members.

    The output works, except for the link.
    A-Z pulls as always the link to the “post”
    -> mywebsite.com/?post_type=dlm_download&p=2868
    but I need here – only for this category! – the protected link from the download manager
    -> mywebsite.com/downloads/2868

    All other lists should not be changed, only this one.

    Can you support me with the implementation?
    Where does which code have to go?

    If this support is chargeable, how can I get it?
    I could not create a support ticket on the website.
    “You do not have the capacity to open a new ticket.”

    Thanks in advance
    Anita

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dani Llewellyn

    (@diddledani)

    Hi,

    The A-Z Listing plugin uses inbuilt WordPress functionality to get the permalink. If your download plugin has a different method of generating the links there’s not much I can do. Ideally they’d hook the post_type_link filter so that it works out of the box but I suspect they aren’t doing this if the link is wrong.

    Thread Starter Anita

    (@wpstube)

    Thank you for your quick answer. I still want to check again, because I can’t imagine that it’s so tricky, so let’s do it the other way round:

    I had imagined it like this:

    If post_type=dlm_download insert custom link
    (custom link like here: https://wordpress.org/support/topic/add-a-custom-url/)
    Otherwise do what always do

    My problem is this if-then query (I can read PHP but not write it myself).
    How can I add this if-then and where?

    Plugin Author Dani Llewellyn

    (@diddledani)

    You should be able to test for the post_type with this (I hope):

    <?php
    $post_type = get_post_type( $a_z_listing->get_the_item_id() );
    if ( 'dlm_download' === $post_type ) {
        // do the download bits here
    }
    ?>
    Thread Starter Anita

    (@wpstube)

    Hooray!
    That worked – I’m happy 🙂
    Thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.