[resolved] Making the title reveal the post (5 posts)

  1. nysus
    Posted 8 years ago #

    AJAXed WP:

    I found this plugin tonight and it looks to do exactly what I want it to. I have been able to set up the comments to hide/reveal but I'm having trouble doing the same with the post. I want the title of the post to reveal the post when clicked.

    <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a><?php do_action('awp_title'); ?></h2>

    That is the closest that I've come, but its obviously not right as I get "Testing the AJAX onclick="aWP.doit({'id': '10', 'type': 'post''show': 'Testing the AJAX ', 'hide': 'Testing the AJAX '}); return false;" id="awppost_link_10"" for a title with nothing being clickable.

    I'm pretty sure that I'm just using the function wrong and any help would be appreciated.


  2. Ajd777
    Posted 8 years ago #

    The code should be:

    <h2><a href="<?php the_permalink() ?>" <?php do_action('awp_title'); ?> rel="bookmark"><?php the_title(); ?></a></h2>

  3. nysus
    Posted 8 years ago #

    Thanks for the help, that worked more or less.

    I do have another question. Can I set it up to where on the main page you just see just the title and when clicked it shows the entire post. I don't want the title to link to the post page and only want that page accessible via clicking on the comment link.

    Is this something that the plugin is set up to handle?

  4. Ajd777
    Posted 8 years ago #

    By default there is no way, but I quickly wrote a module that will do it.

    Just save the file and upload it to your aWP modules folder, and then activate it.

    If you also want to make it so users can't, easily, click the title to go straight to the real page, in the link above change <?php the_permalink() ?> to #.

    Although this will make it impossible for users without JavaScript and search engines to find the page, but it will not keep people who know what they are doing from manually typing in the URL.

  5. gasyoun
    Posted 8 years ago #

    There is no download link on the plugin homepage. Make a button, please!

Topic Closed

This topic has been closed to new replies.

About this Topic