• Resolved kidznc

    (@wsp-kk)


    Hello!

    I’ve been through about 22 different gallery plugins, and so far, yours is the only one I can properly query (like a post) into my blog loop, using FacetWP.

    However, I am having one problem: At present, the code used to create the “Read More” link is as follows:

    <p class="read-more"><a href="<?php the_permalink(); ?>"><?php esc_html_e('Read More &raquo;','photolite'); ?></a></p>

    This works correctly for every other post type except the galleries – the URL is rendered incorrectly using the_permalink(); and this plugin. For example, the following gallery link,

    ../gallery-album-test-kidz-neuroscience-center-task-force-2017/?album=7768

    …when fetched by the_permalink();, winds up written as follows:

    ../?post_type=aigpl_gallery&p=7768

    And, of course, that puts out a 404 – even if I set permalinks back to “plain” from “post name.” This led me to try borrowing code from the plugin’s own design-1.php file, as follows:

    <p class="read-more"><a href="<?php echo $album_image; ?>" target="<?php echo $album_link_target; ?>"><?php esc_html_e('Read More &raquo;','photolite'); ?></a></p>

    But that code only echoes the exact URL of the existing page being viewed. For the record, I also tried:

    <p class="read-more"><a href="<?php echo $album_image; ?>"><?php esc_html_e('Read More &raquo;','photolite'); ?></a></p>

    …to no avail.

    Is there a function within this plugin that I can use here where it’ll output the URL correctly?

    Thanks!

    • This topic was modified 7 years, 3 months ago by kidznc.
    • This topic was modified 7 years, 3 months ago by kidznc.
    • This topic was modified 7 years, 3 months ago by kidznc.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello,

    Thanks for using our plugin.

    You can use gallery with shortcode.Album post type is publicly false, So there is no single page for this.

    Thanks & Regards

    Thread Starter kidznc

    (@wsp-kk)

    Thank you for the reply.

    My apologies for asking for clarification, but I take it then that the only method you support at the moment is via shortcode, correct?

    If so, I understand. I’m sure I can find a PHP guru that can indicate how to either hook into aigpl-gallery-album.php or – if necessary – duplicate the plugin.

    Thank you!

    Hi @wsp-kk

    The plugin is created with shortcode and it’s registered post type is public false because there is no use of it.

    Now in Facet WP it matters how you are using WP Query and taking the permalink. If you take Album post type permalink it will be generated like this /?post_type=aigpl_gallery&p=7768 because it is not publicly view able.

    So we are not sure how your using Facet WP template and ‘Read More’ link but I think you have to get permalink at appropriate place or you can take extra meta as post id to keep track where it is embedded and you can use that meta in permalink.

    I hope it helps ??

    Thanks & Regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Query for album the_permalink() outputs incorrect URL’ is closed to new replies.