Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3968534
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T03:51:16+00:00 2026-05-20T03:51:16+00:00

I’ve installed WordPress on top of wordpress many times, through SVN and replacing folders…

  • 0

I’ve installed WordPress on top of wordpress many times, through SVN and replacing folders… The database remained always the same. Suddenly a fresh copy from SVN can’t work in two different machines with the following code, from wp survey and quiz tool:

function wpsqt_main_site_quiz_page($atts) {

    extract( shortcode_atts( array(
                    'name' => false
    ), $atts) );

    if ( !$name ){
        require_once WPSQT_DIR.'/pages/general/error.php';
    }

    require_once WPSQT_DIR.'/includes/site/quiz.php';
    ob_start();
    wpsqt_site_quiz_show($name);
    $content = ob_get_contents();
    ob_end_clean();
    return $content;
}

add_shortcode( 'wpsqt_page' , 'wpsqt_main_site_quiz_page' );// Deprecated and will be removed
add_shortcode( 'wpsqt_quiz' , 'wpsqt_main_site_quiz_page' );

If I use echo to see where the code is being reached, add_shotcode is being reached while inside the function is not and the page just displays this:

[wpsqt_quiz name="test"]

Instead of replacing it with the expected quiz.php.

Now I just deleted the database got a fresh install of wordpress and the plugin, and of course everything worked fine. If I get the SVN version, which isn’t all that modified (it just got 1 plugin – Magic Fields – and a customized theme), remove the plugin and install it again, it still doesn’t work!

What could be going wrong here? What is everything needed to make add_shortcode work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T03:51:17+00:00Added an answer on May 20, 2026 at 3:51 am

    That problem had been bugging me since yesterday. Finally found out the reason, (now) obviously on the customized template.

    The header included a call to query_posts, which supposedly can only be called once per page load. Then there comes wp_reset_query to rescue. But wait! Seems like both of those functions are deprecated and neither should be used! Instead, we should always use WP_query object.

    So, this works but it’s wrong:

    <?php query_posts('showposts=10'); ?>  
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>  
       <li><a href="<?php the_permalink() ?>"><?php the_title() ?></a></li>  
    <?php endwhile; endif; ?>  
    <?php wp_reset_query(); ?>  
    

    and this is the right and proper way:

    <?php $r = new WP_Query(array('showposts' => '10', 'what_to_show' => 'posts', 'nopaging' => 0, 'post_status' => 'publish', 'caller_get_posts' => 1)); ?>  
    <?php if ($r->have_posts()) : while ($r->have_posts()) : $r->the_post(); ?>  
       <li><a href="<?php the_permalink() ?>"><?php the_title() ?></a></li>    
    <?php endwhile; endif; ?> 
    

    Without that, the subsequent query_posts on the page itself are not properly loaded and thus the [wpsqt_quiz name="test"] inside them (in the page post) is never called.

    Also, it seems like [wpsqt_quiz name="test"] can’t be added to the template page.

    That’s all.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a view passing on information from a database: def serve_article(request, id): served_article
I have a reasonable size flat file database of text documents mostly saved in
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.