Forum Replies Created

Viewing 15 replies - 166 through 180 (of 207 total)
  • i think this might be because you are logged in..

    the new version of WP (ie 3.1) places an ‘admin_bar’ at the top of the page..

    that even when given the style “display:none;” still shows up as a white bar on firefox.

    try logging out and then refreshing the homepage.. as to me it looks fine..

    not without dynamically changing the query_posts/WP_query section of your showcase file.. which wont be easy…

    i wish there was an easier way to say to change the page template for a number of posts.. but without a lengthy SQL query there really isnt..

    place a div around your header..

    give it an id of something like “header_image”

    then in your css file.. use the css styles below

    #header_image{
    width:960px;
    margin:0 auto;
    padding:0;
    }

    adjust you width as necessary

    also if you link us to the page in question i can tell you quickly where the issues lie ??

    Forum: Fixing WordPress
    In reply to: Read More

    have you tried adding something like this to your functions.php

    function new_excerpt_more($more) {
           global $post;
    	return '<a href="'. get_permalink($post->ID) . '">Read the Rest...</a>';
    }
    add_filter('excerpt_more', 'new_excerpt_more');

    you can see more except functions and filters here:

    https://codex.www.ads-software.com/Function_Reference/the_excerpt

    without creating individual pages for each of the results this is going to be a very difficult and lengthy piece of code.. you can create category hierarchies that would mean not all the categories would be shown

    so in your categories menu create a category called “your-city”… then create sub categories (ie categories where “your-city” is the parent) for each of the cities..

    then you can use
    wp_list_categories('child_of=#');

    but just replace the # with the ID of the “your-city” category

    the bonus to doing it THIS way is that you can set your permalink structure to

    ‘/%category%/%postname%’

    and this will allow you to type something like:

    https://www.YOURDOMAIN.com/your-city/dehli

    and this will pull in all the posts that are about the city dehli

    THIS IS THE BEST OPTION.. doing it with custom fields will require a LOT more coding and if you are ‘very new’ to this i would not suggest doing it that way..

    <?php
    
        $authors = $wpdb->get_col("SELECT post_author FROM $wpdb->posts WHERE post_type='post' AND post_status='publish'");
    	$authors = array_unique($authors, SORT_NUMERIC);
            $dont_show = array("1"); //add more users here in ""s comma seperated
    	?>
    
        <ul>
        <?php
        for($j=0; $j < count($authors); $j++){
              if(!in_array($dont_show,$authors[$j]){
              $username = get_userdata($authors[$j]);
              echo "<li><a href=\"";
              bloginfo('url');
              echo"/?author=".$authors[$j]."\" title=\"See all ".$username->user_login."'s posts\">".$username->user_login."</a></li>";
              }
          }
        ?>
        </ul>

    that should be what you are looking for…

    im not sure why it wouldnt tell you all of the users..

    array_unique looks for instances where two array items are IDENTICAL and removes them.. so “one” “one” will become “one”.. but “One” “one” will stay the same.. and these id’s are numbers.. so theres no way they should get confused :S

    EDIT: figured it out.. i think its cos removing duplicates leaves gaps in the array.. just need to re sort it.. code should be right now..

    it also occurs to me that you might not want show profiles like ‘admin’

    i would suggest creating an array of userID’s you DONT want in your list.. here i have included ‘1’ which is the default userID for the admin account..

    <?php
    
        $authors = $wpdb->get_col("SELECT post_author FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'");
    	$authors = array_unique($authors);
            $dont_show = array("1"); //add more users here in ""s comma seperated
    	?>
    
        <ul>
        <?php
        for($j=0; $j < count($authors); $j++){
              if(!in_array($dont_show,$authors[$j]){
              $username = get_userdata($authors[$j]);
              echo "<li><a href=\"";
              bloginfo('url');
              echo"/authors/".str_replace(".","-",$username->user_login).".php\" title=\"".$username->user_login."'s profile\">".$username->user_login."</a></li>";
              }
          }
        ?>
        </ul>

    hope that helps

    also when you’re happy with it how you want.. dont forget to change this thread’s status to resolved in the dropdown box in the right sidebar ??

    ———–>>>>>>>>>>

    enjoy ??

    yay i can see that its working ??

    in so far as linking to the users profile.. it looks like currently you only have 3 profile pages.. you might also want to give their php files more specific names than ‘richard.php’ what would truly make life easier for yourself would be to user php page names that are basically the same as their usernames..

    because you cant use “.”s in page names you could try a

    str_replace(".","-",$username->user_login);

    to swap and .s to -s in the link section..

    so the code would become

    <?php
    
        $authors = $wpdb->get_col("SELECT post_author FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'");
    	$authors = array_unique($authors);
    	?>
    
        <ul>
        <?php
        for($j=0; $j < count($authors); $j++){
              $username = get_userdata($authors[$j]);
              echo "<li><a href=\"";
              bloginfo('url');
              echo"/authors/".str_replace(".","-",$username->user_login).".php\" title=\"".$username->user_login."'s profile\">".$username->user_login."</a></li>";
          }
        ?>
        </ul>

    this would take admin and link it to
    https://www.allthingsplc.info/authors/admin.php

    and richard.dufour and link it to
    https://www.allthingsplc.info/authors/richard-dufour.php

    wow im really not with it tonight.. im putting errors all over the place and just not thinking..

    im helpful cos im procrastinating from working on a project of my own that is being a handful haha but thank you none-the-less

    <?php
    
        $authors = $wpdb->get_col("SELECT post_author FROM $wpdb->posts WHERE post_type='page' AND post_status='publish'");
    	$authors = array_unique($authors);
    	?>
    
        <ul>
        <?php
        for($j=0; $j < count($authors); $j++){
              $username = get_userdata($authors[$j]);
              echo "<li><a href=\"#\" title=\"".$username->user_login."'s profile\">".$username->user_login."</a></li>";
          }
        ?>
        </ul>

    there is the code for pulling all users that have ever posted a post and displaying a list of their names that link currently to #

    oh wow haha ok this is a slightly different thing.. but not undoable..

    as for linking to their profile page.. i might have to leave that up to you.. you would just need to add the link where the # is currently

    <?php
    $authors = $wpdb->get_col("SELECT post_author FROM $wpdb->posts" WHERE post_type='page' AND post_status='publish'); ?>
    $authors = array_unique($authors);
    
    <ul>
    <?php
    for($j=0; $j < count($authors); $j++){
          echo "<li><a href=\"#\" title=\"".$authors[$j]."'s profile\">".$authors[$j]."</a></li>";
      }
    ?>
    </ul>

    ive included the links and title now
    this should give you a list of anyone that has ever made a post

    Forum: Fixing WordPress
    In reply to: 404 error

    perfect ??

    and yes.. it is currently 1:40am where i am.. so it is most peoples tomorrow ?? when its my today

    dont forget to mark this as resolved in the right hand sidebar

    ————->>>>>>>>>

    enjoy ??

    are the people that you say are ‘authors’ actually set to be ‘Author’ in their user role?

    by this i mean.. under your users section of the dashboard.. click ‘edit’ on any of the users you want to show and check that their role is set to Author..

    if you want a list of people from a different role let me know and ill make the changes

    Forum: Fixing WordPress
    In reply to: 404 error

    if you can see the posts when you click the ‘view post’ from with in the dashboard but not from on the blog.. it means there something wrong with how the links on the blog are connecting to the post..

    when you click from the ‘view post’ button have a look are the URL of the post and make sure that any link references your blog is making (ie the_permalink()) or in your navigation look the same..

    oh for the love of god.. i typed a 0 instead of a close bracket…

    <?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_IDs)){
          //things before the username
          echo "<li>".$users[$j]->user_login."</li>";
          //things after the username
        }
      }
    ?>
    </ul>

    i have tested this on my own server and it works ok for me ??

    oh and delete that error checking thing from the top of the page now too…

    yes.. its 1am in Australia.. im sorry

Viewing 15 replies - 166 through 180 (of 207 total)