Forum Replies Created

Viewing 15 replies - 1 through 15 (of 21 total)
  • Thread Starter kargo

    (@kargo)

    Thank you so so much for your help, this works beautifully!

    I can’t tell you how much I appreciate your time. I have learnt so much from this post alone.

    Thread Starter kargo

    (@kargo)

    Thanks so much again for your help, I appreciate it. I’ve got a little further thanks to your tips. on the homepage of my site http://www.escxtra.com I have the dropdown on the sidebar and as far as I can see query URL looks correct:

    /?meta_key=country&meta_value=Croatia

    but its not actually showing any search results, it more or less just refreshes the homepage. Do I need to build a new search page?

    <?php /* You can also leave 'action' blank: action="" */ ?>
    <form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
    <input type="hidden" id="meta_key" name="meta_key" value="country">
    <select name="meta_value" id="meta_value" class="postform" onchange="submit();">
            <option selected="selected">Select a Country</option>
    <img src="/images/flags/16/Albania.png"> <option value="Albania">Albania</option>
    <img src="/images/flags/16/Andorra.png"> <option value="Andorra">Andorra</option>
    <img src="/images/flags/16/Armenia.png"> <option value="Armenia">Armenia</option>
    <img src="/images/flags/16/Australia.png"> <option value="Australia">Australia</option>
    <img src="/images/flags/16/Austria.png"> <option value="Austria">Austria</option>
    <img src="/images/flags/16/Azerbaijan.png"> <option value="Azerbaijan">Azerbaijan</option>
    <img src="/images/flags/16/Belarus.png"> <option value="Belarus">Belarus</option>
    <img src="/images/flags/16/Belgium.png"> <option value="Belgium">Belgium</option>
    <img src="/images/flags/16/Bosnia-and-Herzegovina.png.png"> <option value="Bosnia & Herzegovina">Bosnia & Herzegovina</option>
    <img src="/images/flags/16/Bulgaria.png"> <option value="Bulgaria">Bulgaria</option>
    <img src="/images/flags/16/Croatia.png"> <option value="Croatia">Croatia</option>
    <img src="/images/flags/16/Cyprus.png"> <option value="Cyprus">Cyprus</option>
    <img src="/images/flags/16/Czech Republic.png"> <option value="Czech Republic">Czech Republic</option>
    <img src="/images/flags/16/Denmark.png"> <option value="Denmark">Denmark</option>
    <img src="/images/flags/16/Finland.png"> <option value="Finland">Finland</option>
    <img src="/images/flags/16/France.png"> <option value="France">France</option>
    <img src="/images/flags/16/Macedonia.png"> <option value="FYR Macedonia">FYRMacedonia</option>
    <img src="/images/flags/16/Georgia.png"> <option value="Georgia">Georgia</option>
    <img src="/images/flags/16/Germany.png"> <option value="Germany">Germany</option>
    <img src="/images/flags/16/Greece.png"> <option value="Greece">Greece</option>
    <img src="/images/flags/16/Hungary.png"> <option value="Hungary">Hungary</option>
    <img src="/images/flags/16/Iceland.png"> <option value="Iceland">Iceland</option>
    <img src="/images/flags/16/Ireland.png"> <option value="Ireland">Ireland</option>
    <img src="/images/flags/16/Israel.png"> <option value="Israel">Israel</option>
    <img src="/images/flags/16/Italy.png"> <option value="Italy">Italy</option>
    <img src="/images/flags/16/Latvia.png"> <option value="Latvia">Latvia</option>
    <img src="/images/flags/16/Lithuania.png"> <option value="Lithuania">Lithuania</option>
    <img src="/images/flags/16/Luzembourg.png"> <option value="Luxembourg">Luxembourg</option>
    <img src="/images/flags/16/Malta.png"> <option value="Malta">Malta</option>
    <img src="/images/flags/16/Moldova.png"> <option value="Moldova">Moldova</option>
    <img src="/images/flags/16/Montenegro.png"> <option value="Montenegro">Montenegro</option>
    <img src="/images/flags/16/Netherlands.png"> <option value="Netherlands">Netherlands</option>
    <img src="/images/flags/16/Norway.png"> <option value="Norway">Norway</option>
    <img src="/images/flags/16/Poland.png"> <option value="Poland">Poland</option>
    <img src="/images/flags/16/Portugal"> <option value="Portugal">Portugal</option>
    <img src="/images/flags/16/Romania.png"> <option value="Romania">Romania</option>
    <img src="/images/flags/16/Russia.png"> <option value="Russia">Russia</option>
    <img src="/images/flags/16/San Marino.png"> <option value="San Marino">San Marino</option>
    <img src="/images/flags/16/Serbia.png"> <option value="Serbia">Serbia</option>
    <img src="/images/flags/16/Slovakia.png"> <option value="Slovakia">Slovakia</option>
    <img src="/images/flags/16/Slovenia.png"> <option value="Slovenia">Slovenia</option>
    <img src="/images/flags/16/Spain.png"> <option value="Spain">Spain</option>
    <img src="/images/flags/16/Sweden.png"> <option value="Sweden">Sweden</option>
    <img src="/images/flags/16/Switzerland.png"> <option value="Switzerland">Switzerland</option>
    <img src="/images/flags/16/Turkey.png"> <option value="Turkey">Turkey</option>
    <img src="/images/flags/16/Ukraine.png"> <option value="Ukraine">Ukraine</option>
    <img src="/images/flags/16/United Kingdom.png"> <option value="United Kingdom">United Kingdom</option>
    <img src="/images/flags/16/United States.png"> <option value="United States">United States</option>
    </select>
    </form>
    
    <?php
    if( !isset($_POST['country']) || '' == $_POST['country']) {
    
    }
    else {
    
     
        $size = $_POST['country'];
    
        $query = new WP_Query( array(
            'post_type'=> 'post', 
            'post_status' => 'publish',
            'meta_key' => 'country',
            'meta_value' => $country, 
        ) );
    
        // Loop
        if($query->have_posts()):
            while( $query->have_posts() ): $query->the_post();
                // Product content
            endwhile;
        endif;
    
        // reset query to default
        wp_reset_postdata();
    
    }
    • This reply was modified 8 years, 3 months ago by kargo.
    Thread Starter kargo

    (@kargo)

    Thank you so much for the reply 🙂

    So far I have this which displays the dropdown list but doesn’t appear to show any search results. Results are showing like this which is almost there:

    https://www.escxtra.com/?country=Austria

    
    <form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
    <select name="country" id="country" class="postform" onchange="submit();">
            <option selected="selected">Select a Country</option>
    <img src="/images/flags/16/Albania.png"> <option value="Albania">Albania</option>
    <img src="/images/flags/16/Andorra.png"> <option value="Andorra">Andorra</option>
    <img src="/images/flags/16/Armenia.png"> <option value="Armenia">Armenia</option>
    <img src="/images/flags/16/Australia.png"> <option value="Australia">Australia</option>
    <img src="/images/flags/16/Austria.png"> <option value="Austria">Austria</option>
    <img src="/images/flags/16/Azerbaijan.png"> <option value="Azerbaijan">Azerbaijan</option>
    <img src="/images/flags/16/Belarus.png"> <option value="Belarus">Belarus</option>
    <img src="/images/flags/16/Belgium.png"> <option value="Belgium">Belgium</option>
    <img src="/images/flags/16/Bosnia-and-Herzegovina.png.png"> <option value="Bosnia & Herzegovina">Bosnia & Herzegovina</option>
    <img src="/images/flags/16/Bulgaria.png"> <option value="Bulgaria">Bulgaria</option>
    <img src="/images/flags/16/Croatia.png"> <option value="Croatia">Croatia</option>
    <img src="/images/flags/16/Cyprus.png"> <option value="Cyprus">Cyprus</option>
    <img src="/images/flags/16/Czech Republic.png"> <option value="Czech Republic">Czech Republic</option>
    <img src="/images/flags/16/Denmark.png"> <option value="Denmark">Denmark</option>
    <img src="/images/flags/16/Finland.png"> <option value="Finland">Finland</option>
    <img src="/images/flags/16/France.png"> <option value="France">France</option>
    <img src="/images/flags/16/Macedonia.png"> <option value="FYR Macedonia">FYRMacedonia</option>
    <img src="/images/flags/16/Georgia.png"> <option value="Georgia">Georgia</option>
    <img src="/images/flags/16/Germany.png"> <option value="Germany">Germany</option>
    <img src="/images/flags/16/Greece.png"> <option value="Greece">Greece</option>
    <img src="/images/flags/16/Hungary.png"> <option value="Hungary">Hungary</option>
    <img src="/images/flags/16/Iceland.png"> <option value="Iceland">Iceland</option>
    <img src="/images/flags/16/Ireland.png"> <option value="Ireland">Ireland</option>
    <img src="/images/flags/16/Israel.png"> <option value="Israel">Israel</option>
    <img src="/images/flags/16/Italy.png"> <option value="Italy">Italy</option>
    <img src="/images/flags/16/Latvia.png"> <option value="Latvia">Latvia</option>
    <img src="/images/flags/16/Lithuania.png"> <option value="Lithuania">Lithuania</option>
    <img src="/images/flags/16/Luzembourg.png"> <option value="Luxembourg">Luxembourg</option>
    <img src="/images/flags/16/Malta.png"> <option value="Malta">Malta</option>
    <img src="/images/flags/16/Moldova.png"> <option value="Moldova">Moldova</option>
    <img src="/images/flags/16/Montenegro.png"> <option value="Montenegro">Montenegro</option>
    <img src="/images/flags/16/Netherlands.png"> <option value="Netherlands">Netherlands</option>
    <img src="/images/flags/16/Norway.png"> <option value="Norway">Norway</option>
    <img src="/images/flags/16/Poland.png"> <option value="Poland">Poland</option>
    <img src="/images/flags/16/Portugal"> <option value="Portugal">Portugal</option>
    <img src="/images/flags/16/Romania.png"> <option value="Romania">Romania</option>
    <img src="/images/flags/16/Russia.png"> <option value="Russia">Russia</option>
    <img src="/images/flags/16/San Marino.png"> <option value="San Marino">San Marino</option>
    <img src="/images/flags/16/Serbia.png"> <option value="Serbia">Serbia</option>
    <img src="/images/flags/16/Slovakia.png"> <option value="Slovakia">Slovakia</option>
    <img src="/images/flags/16/Slovenia.png"> <option value="Slovenia">Slovenia</option>
    <img src="/images/flags/16/Spain.png"> <option value="Spain">Spain</option>
    <img src="/images/flags/16/Sweden.png"> <option value="Sweden">Sweden</option>
    <img src="/images/flags/16/Switzerland.png"> <option value="Switzerland">Switzerland</option>
    <img src="/images/flags/16/Turkey.png"> <option value="Turkey">Turkey</option>
    <img src="/images/flags/16/Ukraine.png"> <option value="Ukraine">Ukraine</option>
    <img src="/images/flags/16/United Kingdom.png"> <option value="United Kingdom">United Kingdom</option>
    <img src="/images/flags/16/United States.png"> <option value="United States">United States</option>
    </select>
    </form>
    
    <?php
    if( !isset($_POST['country']) || '' == $_POST['country']) {
    
    }
    else {
    
        $size = $_POST['country'];
    
        // Create new query
        $query = new WP_Query( array(
            'post_type'=> 'post', 
            'post_status' => 'publish',
            'meta_key' => 'country',
            'meta_value' => $country, // Dropdown value
        ) );
    
        // Loop
        if($query->have_posts()):
            while( $query->have_posts() ): $query->the_post();
            endwhile;
        endif;
    
        // reset query to default
        wp_reset_postdata();
    
    }
    
    • This reply was modified 8 years, 3 months ago by kargo.
    • This reply was modified 8 years, 3 months ago by kargo.

    Broken here too! Caused a lot of confusion amongst readers and editors.

    Thread Starter kargo

    (@kargo)

    Thank you for the reply.

    I have double checked the HTML and there isn’t anything there thats changed recently. its very strange.

    Getting the exact same issue, never happened previously up until recently.

    View post on imgur.com

    Here is the coding of my page template although I do not think there is an issue with it as it hasn’t changed since it worked.

    http://pastebin.com/BevGW5FW

    The error console shows this if its any help.

    “Failed to load resource: the server responded with a status of 404 (Not Found) http://escxtra.com/2013/03/live-blogging-test-2/liveblog/crud&#8221;

    Please fix this!

    I have a custom permalink setup and its not working.

    I’m having the same problem. Refreshing several times did not fix the problem. I have followed the steps above but nothing has helped.

    Thread Starter kargo

    (@kargo)

    Thank you for the reply and information. Any ideas what I could do to fix this? Is W3 Total Cache for Minify not a good idea to use?

    Thanks

    Dan

    Yes I’m having exactly the same problem. There must be a bug in this new version as it was fine before. Please fix this

    Thread Starter kargo

    (@kargo)

    Apologies mods.
    http://www.escdaily.com

    I added the code above and the styling suggested to my CSS but still the colour isnt changing. Am I doing something wrong?

    Thread Starter kargo

    (@kargo)

    Thank you for posting ^

    I have added the code you suggested and it seems to work with no errors although the colours are still not showing.

    I added

    [CSS moderated as per the Forum Rules. Please post a link to your site instead.]

    but still its showing up the default blue when I post in the selected category. Am I doing something wrong?

    Thread Starter kargo

    (@kargo)

    Thank you everyone 🙂

    I’ve just read the codex and tried it out for myself but I seem to be getting a syntax error each time so I’m guessing ive done something wrong.

    here is the code of the ‘Top Story’ section that I’d like to change colour
    http://wordpress.pastebin.com/iiGdHeaZ

    What would I need to add to the CSS? Just something like this?

    .category-79 {
    
    	background: #8b0000;
    
        color: #fafad2;
    
    	font-size: 22px;
    
    	line-height: 26px;
    
    	}
    Forum: Plugins
    In reply to: Plugin: World Cup Predictor

    This is a fantastic plugin!

    Is there anyway you could make one for the Eurovision Song Contest? It has 39 countries taking part in total and I help run a Eurovision news website and something like this would be ideal.

    Thanks 🙂

    Thread Starter kargo

    (@kargo)

    Anyone have any ideas? Sorry if I didn’t explain it clearly.

Viewing 15 replies - 1 through 15 (of 21 total)