• Resolved concertravellers

    (@concertravellers)


    I’m currently trying to customize the plugin for my archive page. The thing is: I don’t want to link to the single post when clicking on the listing which is the default setting. I want to direct the user to the post on the homepage, preferrably with the post-id.

    My shortcode currently looks like this:
    [a-z-listing display="posts" post-type="post" target="https://387785-12.web1.fh-htwchur.ch/#<?php the_id(); ?>"]

    Which I added in the backend to my page, but it does not seem to do anything. Do I have to add something to my functions.php? Or to my tepmlate part?

    Thanks in advance!

    The page I need help with: [log in to see the link]

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

    (@diddledani)

    The target attribute doesn’t do that. It is for internal use to point the letters in the widget to a specific page, which should be edited to include a separate listing (without target=).

    To change the target of the titles shown in the listing, i.e. the titles of the posts, you need to create a template in your theme called a-z-listing.php. You can copy the default one from wp-content/plugins/a-z-listing/templates/a-z-listing.php and customise that. You will want to find line 57 with the following content:

    <a href="<?php $a_z_query->the_permalink(); ?>">
    

    You can change that to something like:

    <a href="https://387785-12.web1.fh-htwchur.ch/#<?php $a_z_query->the_item_id(); ?>">
    

    I think that will do what you are aiming to achieve..

    If the target page is on the same domain, you can also make it easier to move domains by dropping that part of the URL and rely on the browser expanding it:

    <a href="/#<?php $a_z_query->the_item_id(); ?>">
    
    Thread Starter concertravellers

    (@concertravellers)

    Thank you!

    The problem I now have, is that it doesn’t seem to recognize the function the_letters(). I get a fatal error. Do you know what problem that could be?

    Plugin Author Dani Llewellyn

    (@diddledani)

    the_letters() should be $a_z_query->the_letters().

    Thread Starter concertravellers

    (@concertravellers)

    I did actually check that, but that didn’t seem to be the problem. Anyways, I changed my mind to display the posts and don’t have to change the link anymore. Thanks for your help anyways! 😀

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

The topic ‘Add a custom url’ is closed to new replies.