Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter hretter

    (@hretter)

    I ended up modifying shortcodes.php to include the id when displaying as style=”block”:

    while ($flfaq->have_posts()) : $flfaq->the_post();
       $faqid = $post->ID;
    ?>
      <li class="faq-block-item">
      <div class="faq-block-question" id="<?php echo $faqid; ?>"><?php the_title(); ?></div>

    Is there a better way to do this? Thanks.

    Thread Starter hretter

    (@hretter)

    I would like to suggest a short_code that generates a list of questions:

    <ul>
      <li class="faq-block-item" id="xxx">
      <div class="faq-block-question">Does xxx do yyy?</div>
    
      ...
    </ul>

    I could place this short_code in a sidebar. Thanks.

    Thread Starter hretter

    (@hretter)

    Son of a gun. I modified shortcodes with this:

    elseif ($style=="qlist") :
    			echo '<div class="faq-questions">';
    			echo '<ul>';
    			while ($flfaq->have_posts()) : $flfaq->the_post();
                               $faqid = $post->ID;
    			?>
    				<li class="faq-block-item">
    				   <a href="#<?php echo $faqid; ?>"><div class="faq-block-question"><?php the_title(); ?></div></a>
    				</li>
    			<?php
    			endwhile;
    			echo '</ul>';
    			echo '</div>';

    and I now have a [faq style=qlist] that creates a list of links to the faqs.

    Plugin Author Bage

    (@bagerathan)

    That is an important feature. I will include it in the next update.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add id attribute to question and answer’ is closed to new replies.