haxxxton
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: List authors function mysteriously not workingoh WOW im silly
im sorry… here this IS THE CORRECT CODE!! (i not only forgot my closing bracket i also forgot that multi dimentional arrays dont get accessed like that in PHP )
$author_IDs = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='wp_user_level' AND meta_value='2'"); $users = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users"); ?> <ul> <?php for($j=0; $j < count($users); $j++){ if(in_array($users[$j]->ID,$author_IDs0){ //things before the username echo "<li>".$users[$j]->user_login."</li>"; //things after the username } } ?> </ul>
as a sorry again i put it in a list for you…
my bad
Forum: Fixing WordPress
In reply to: Two Loops integrated – issuecan you link me to the page this is happening on or are you using a local testing server?
Forum: Fixing WordPress
In reply to: Strange Problem with Static Pageif you havent manually changed your permalinks on your posts other than the post name then they should auto update..
the addition of /blog/ is where i think the problem lies..
i would suggest making a category called ‘blog’ and place all posts that you want to read on the blog page under that category.. then change your permalinks to
/%category%/%year%/%monthnum%/%postname%/
the other thing that could be messing it up is if you have a really tight htaccess file that is telling all traffic that leads to a subpage to be an index of page.. but this is unlikely as im sure you have more than just a homepage and a blog page
Forum: Fixing WordPress
In reply to: Trouble with tablesgreat,
dont forget to mark this thread solved in from the drop down in the sidebar on the right hand side ——->>>>>>>
enjoy ??
Forum: Fixing WordPress
In reply to: Anchor link to other page not workingno worries..
dont forget to mark this thread as solved by changing to drop down box in the right sidebar ——->>>>
enjoy your tabley mischief haha
Forum: Fixing WordPress
In reply to: List authors function mysteriously not workingok if ever you are getting a blank page like that it means there is a php error.. so i may have typed something wrong if you jsut copy pasted..
to check if thats the case.. pop
error_reporting(E_ALL); ini_set('display_errors', '1');
at the top of the archive page and it should tell you if you have made a call to an unknown function or something..
i can actually see where i have gone wrong.. let me ammend my code and ill comment where to add list items around the names the section you want to edit is in the comparison loop:
$author_IDs = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='wp_user_level' AND meta_value='2'"); $users = $wpdb->get_results("SELECT ID, user_login FROM $wpdb->users"); for($j=0; $j < count($users); $j++){ if(in_array($users[$j][ID],$author_IDs){ //things before the username echo $users[$j][user_login]; //things after the username } }
now if you wanted them to be list items youd want to replace my comments with
echo "<li>";
and
echo "</li>";
respectfully
sorry for the mess up
i also forgot that you were going to want the users username not just their ID..
Forum: Fixing WordPress
In reply to: get variables value from permalinkare you wanting to find out this information on the post page? (ie: single.php)
you could try the get_query_var function
https://codex.www.ads-software.com/Function_Reference/get_query_var
Forum: Fixing WordPress
In reply to: Two Loops integrated – issueif your slider is called before your page loop you might want your
wp_reset_query();
after the Coda Slider endwhile; just to stop it from potentially interfering
also:
I had a similar thing happening to me the other day with the use of query_posts()
i changed to WP_query and it seemed to fix the issue.. have a look at the reference
https://codex.www.ads-software.com/Function_Reference/WP_Query
Forum: Fixing WordPress
In reply to: List authors function mysteriously not workingi havent seen it mentioned as an issue with 3.1 although i dont suppose people use that function much..
it appears to still be on the 3.1 function list so it hasnt been depreciated.. in fact they added functionality to it by allowing orderby and number
https://codex.www.ads-software.com/Function_Reference/wp_list_authors
Forum: Fixing WordPress
In reply to: Getiing posts by custom field? Plz help plzI probably wouldnt do it like this if thats what you are trying to do to be honest..
i would set up categories for each of the cities “Delhi, Pune, Mumbai etc” and then use categories to define your pages.. this means you can put
wp_list_categories (https://codex.www.ads-software.com/Template_Tags/wp_list_categories)
above the section that starts <?php if have_posts: while have_posts…
in your index.php of your templateyou will need to do a bit of styling to get it how you want.. but this by much easier than my first reply
Forum: Fixing WordPress
In reply to: List authors function mysteriously not workingim not sure why this isnt working.. but i can tell you how to get a list of the authors..
get the user ID’s of all authors (wp_user_level = 2)
$author_IDs = $wpdb->get_col("SELECT user_id FROM $wpdb->usermeta WHERE meta_key='wp_user_level' AND meta_value='2'");
get all users to compare to
$users = $wpdb->get_col("SELECT ID FROM $wpdb->users");
compare
for($j=0; $j < count($author_IDs); $j++){ if(in_array($author_IDs,$users){ echo $author_IDs[$j]; } }
not the most elegant coding.. but hey ??
Forum: Fixing WordPress
In reply to: cascading menu – how to stop it over lappinghey bodger,
in your stylesheet entitled base.css
on line 104.. you have a style that refers to .nav li
you need to delete the style property of “z-index:9999;”
then it should work again ??
hope this helps
Forum: Fixing WordPress
In reply to: Trouble with tablesmuch easier.. however isnt very dynamic.. this means that in order to update your interest rates someone has to manually go through and change all the data.. but it is much easier…
adding an input box to get posts from specific dates isnt too hard..
have a look at
https://codex.www.ads-software.com/Function_Reference/query_posts
and
https://codex.www.ads-software.com/Function_Reference/WP_Query
to help you with being able to select posts from certain dates..
Forum: Fixing WordPress
In reply to: Anchor link to other page not workingthis is something to do with your mod-rewrite rules..
as you can see when you click on a link that does not end in a trailing slash
ie. https://www.blockpavingsurrey.co.uk/new/portfolio
it changes the url to:
https://www.blockpavingsurrey.co.uk/new/portfolio/
this then destroys your anchoring..
try changing your permalink settings so that they do not have a trailing slash on the end or check that your htaccess file is not adding them for you..
once this stops happening your anchors should be working again..
PS. ARGH TABLES USED AS LAYOUT!!!
Forum: Fixing WordPress
In reply to: 404 erroris the 404 occurring when you click on the ‘view post’ from within the dashboard or from links on the blog itself?