Forum Replies Created

Viewing 15 replies - 1 through 15 (of 48 total)
  • Hi, that’s pretty much it, the arrow there is referencing a method or property of a defined php class, in this case the $wp_query object. In this usage it’s a bit like getting the value of an array. Read more about $wp_query properties here.

    More reading classes in the php manual here.

    Try going to google and using this advanced search to list the indexed url’s for your domain:

    site:www.example.com

    You could email the plugin author requesting this feature, as they could implement it for a future release.

    It’s rather difficult to extend an already complex plugin. Additionally, it’s not recommended because you’re locked into the customized version rather than being able to upgrade to new releases by the plugin author.

    That said, search engines should be able to find your paginated urls regardless of being included in a sitemap.

    Looks like the block of code that displays “comments are closed” is wrapped in an “if there are no comments yet” condition. Remove that condition by deleting this line and the endif pair at the end and it should display for all posts, not just ones with no comments yet.

    Delete this line:

    <?php else : // this is displayed if there are no comments so far ?>

    that’s above the following code

    <?php if ('open' == $post->comment_status) : ?>
    		<!-- If comments are open, but there are no comments. -->
    <div class="comments">
    		<h2 id="comments">Comments</h2>
    		<p>There are no comments for this entry yet. Add your comment by adding the form to your right.</p>
    </div>
    
    	 <?php else : // comments are closed ?>
    		<!-- If comments are closed. -->
    
    <div class="comment-post">
    <h2 id="respond">Comments are Closed</h2>
    
    <strong>Comments are now closed for this article.</strong></p>
    </div>
    
    	<?php endif; ?>

    and delete this endif that follows the code above:

    <?php endif; ?>

    Here’s a plugin for displaying wordpress ascii art. Doesn’t look like you can make things other than words, but maybe you could adapt their technique for your client.

    Forum: Fixing WordPress
    In reply to: wp_user_level

    There used to be a user_level field in older versions of wordpress. Version 2.5 and later no longer use this field.

    If you’re still using old installations of wordpress, you might want to think about upgrading wordpress.

    Based on what you wrote above “but how can I exclude it also from the posts that are both member of cat 22 AND cat 6 – while it remains on posts only member of cat 6?”, replace:

    is_category(9) || (is_single() && in_category(9))

    with

    in_category('22') && in_category('6')

    This will show only if they’re in both cat 22 and cat 6.

    Use the_content() to print the full post, you can replace your code with the following:

    <?php $postslist = get_posts('numberposts=1'); ?>
    <?php foreach ($postslist as $post) : setup_postdata($post); ?>
    <li class="lnk2">
      <?php the_date(); ?><br /><?php the_title(); ?><br /><?php the_content(); ?>
    </li>
    <?php endforeach; ?>

    If you just want to link to the post, try this:

    <?php $postslist = get_posts('numberposts=1'); ?>
    <?php foreach ($postslist as $post) : setup_postdata($post); ?>
    <li class="lnk2">
      <?php the_date(); ?><br /><a href="<?php the_permalink();?>"><?php the_title(); ?></a>
    </li>
    <?php endforeach; ?>
    Forum: Fixing WordPress
    In reply to: wp_user_level

    Hi, wp_user_level is a row entry in the user_meta table, not its own field. You won’t see it in the table structure but as a meta_key that’s data in the table. From the sounds of it there is nothing you need to fix.

    Sorry, my bad, an extra / slipped in the filename. This is corrected:

    <img src="https://www.emlynch.com/wordpress/wp-content/uploads/2009/10/brand.gif"/>

    Try changing this

    <a img src="https://www.emlynch.com/wordpress/wp-content/uploads/2009/10/brand.gif"; no-repeat;></a>

    to

    <img src="https://www.emlynch.com/wordpress/wp-content/uploads/2009/10/brand.gif/"/>

    You were mixing up html and css styling a bit, so it wouldn’t render right. (“a” tags are links). Learn more about img tags here.

    Hi, try this solution:

    Replace

    <a href="<?php echo wp_lostpassword_url( $redirect ); ?>" title="Retrieve password">Lost your password?</a>

    with

    <?php
    if ( !is_user_logged_in() ) { ?>
    <a href="<?php echo wp_lostpassword_url( $redirect ); ?>" title="Retrieve password">Lost your password?</a>
    <?php }
    ?>

    This way the lost your password link only shows up if they’re not logged in, i.e. will disappear if they’re logged in. Good luck!

    Check for folio-format.php in your Sharpfolio theme folder and remove the following code to remove all links to comments on the home page:

    <p class="comment-link">
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
    </p>

    It should do the trick as index.php (your home page) loads that file to display the recent posts.

    Also, if you want to keep the link to comments when you allow a comment, change the code to this instead of deleting it:

    <p class="comment-link">
    <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »',''); ?>
    </p>

    More info on comments_popup_link here.

    It should only apply to subfolders, so if wordpress is installed to https://www.yourdomain.com/wordpress/ and you put robots.txt in https://www.yourdomain.com/wordpress/robots.txt, it should be fine.

    To identify each file you want to exclude, and not folders and domains, you can also put this information in meta fields in the html or wordpress theme template directly, for example:

    <html>
    <head>
    <title>...</title>
    <META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
    </head>

    More info on the meta no robots approach here.

    Another idea would be to forward all traffic coming to your under-development site to the new site, using something like this:

    <META
    HTTP-EQUIV="Refresh"
    CONTENT="5; URL=autoforward_target.html">

    Here are two ways to display the registration link if the user is not logged in:

    <?php
    if ( is_user_logged_in() ) {
    //do nothing
    } else {
        wp_register();
    };
    ?>

    or another way to write it:

    <?php
    if ( !is_user_logged_in() ){
        wp_register();//display registration link if not logged in
    };
    ?>

    More info on wp_register() here.

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