Forum Replies Created

Viewing 15 replies - 61 through 75 (of 75 total)
  • Thread Starter Rose

    (@eos-rose)

    Thank you. I actually figured out an alternative using css. ??

    Thread Starter Rose

    (@eos-rose)

    It worked! Thank you!

    Forum: Fixing WordPress
    In reply to: Hacked
    Thread Starter Rose

    (@eos-rose)

    Wow, okay, I wasn’t really thinking. Rather than re-installing, I set about overwriting files–and wouldn’t you know it, I found the culprit? Someone had added that ugly mess to my index.php file in the main directory. I’m not sure why I never thought of that particular file; in retrospect it’s pretty obvious. ??

    Forum: Fixing WordPress
    In reply to: Hacked
    Thread Starter Rose

    (@eos-rose)

    Update: I just went through and deactivated all my plugins. No change. I’m going to assume that something is up with my wordpress installation.

    Thread Starter Rose

    (@eos-rose)

    It just occurred to me that I’m thinking about this incorrectly. I’m pretty sure whatever is wrong must be somewhere in my code that is intended to display my posts in a 3-column table:

    <table class="results">
    
    <?php
    // Show a selected number of posts per row
    $posts_per_row = 3;
    $posts_per_page = 12;
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args = array(
       'posts_per_page' => $posts_per_page,
       'paged' => $paged,
    );
    query_posts($args);
    if (have_posts()) {
       while (have_posts()) {
          the_post();
          if ((++$post_counter % $posts_per_row) == 1  || $posts_per_row == 1) {
             if ($post_counter > 1) {
                echo "</tr><!-- End of post_row -->";  // End previous row
             }
             echo "<tr>";  // Start a new row
          }
          echo "<td class=result>";  // Start one post
             // Output post data here
    
    echo '<span class=date>Released ';the_time('F j, Y');echo ' at ';the_time();echo '</span>';
             echo '<h1><a href="';the_permalink();echo '">';the_title();echo '</a></h1>';
    if (get_post_meta($post->ID, 'author', false)) {
    echo '<blockquote>written by ';$metas = get_post_meta($post->ID,'author',false);
       if(count($metas) >1) { echo 'Multiple Authors'; }
    else { echo $metas[0]; }
    echo '<br />'; }
    
    if(get_post_meta($post->ID, 'summary', true)) { echo '<blockquote>';echo get_post_meta($post->ID, 'summary', true); echo '</blockquote>'; }
    
    }
    
          echo "</td><!-- End of post_class -->";  // End of post
       } ?>
    
       <!-- End of post_row -->
    
    <?php } else {
       // Code for no posts found
    echo "<tr><td colspan=3><p>No posts found.</p></td></tr>";
    }
    ?>
    </table>

    Any idea where the problem is?

    Rose

    (@eos-rose)

    Try:

    :Any,Chairman and CEO,President,Managing Director,Principal,Director,Vice President

    Forum: Themes and Templates
    In reply to: WP-Creativix
    Thread Starter Rose

    (@eos-rose)

    I found a solution! There’s probably a much cleaner way of doing this, but after searching the forums and doing some more experimentation, I made this work for me.

    Insert the following into functions.php:

    function postimage() {
    	if ( $images = get_children(array(
    		'post_parent' => get_the_ID(),
    		'post_type' => 'attachment',
    		'numberposts' => 1,
    		'post_mime_type' => 'image',)))
    	{
    		foreach( $images as $image ) {
    			$attachmenturl=wp_get_attachment_url($image->ID);
    
    			echo ''.$attachmenturl.'';
    		}
    	} else {
    		$bloginfo = bloginfo('template_directory');
    		echo $bloginfo."/images/add-feat.png";
    	}
    }

    Replace the index.php code I indicated in my first post with the following:

    [Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]

    I’m certain that my way makes parts of the code redundant, but the slideshow now draws on attached images rather than a custom field, so yay?

    Also inserting the following code in single.php (or wherever appropriate) will call up the raw image url:
    <?php postimage(); ?>

    Thread Starter Rose

    (@eos-rose)

    I haven’t figured out how to do this, but I figured out an acceptable alternative.

    Thread Starter Rose

    (@eos-rose)

    Thank you, this worked perfectly. And thanks for the links too!

    Thread Starter Rose

    (@eos-rose)

    That sounds promising. I’ll give it a shot!

    Thread Starter Rose

    (@eos-rose)

    P.S. I found a plugin that will display the text of an include, but won’t run the actual PHP code within the include. Huh.

    Thread Starter Rose

    (@eos-rose)

    I’m not really familiar with that. Would that replace the content entirely? That’s not really what I’m trying to do. At this point, I’m considering placing ALL content in custom fields and ignoring the content box entirely. If I can make shortcodes work in custom fields, that might be the easiest all the way around.

    Thread Starter Rose

    (@eos-rose)

    I finally found it! The document that needs to be edited is downloadable_file.class.

    Thread Starter Rose

    (@eos-rose)

    Awesome! I knew there must be an easy way to do this. <3

    Thread Starter Rose

    (@eos-rose)

    Thank you. I haven’t tried it yet, but it looks straightforward enough.

Viewing 15 replies - 61 through 75 (of 75 total)