www.webdeveloper.com
Results 1 to 2 of 2

Thread: Basic coding assistance needed

  1. #1
    Join Date
    Apr 2005
    Posts
    92

    Basic coding assistance needed

    I am using a Wordpress plugin (WP Favorite Posts). The problem I am having is that by default the plugin simply lists the users favorite posts as plain text in a UL menu. I want to style it the same way that I do on my main page. Can someone please help me rewrite this code to match the format that follows.

    Default code:

    PHP Code:
    <?php
        
    echo "<div class='wpfp-span'>";
        if (!empty(
    $user)):
            if (!
    wpfp_is_user_favlist_public($user)):
                echo 
    "$user's Favorite Posts.";
            else:
                echo 
    "$user's list is not public.";
            endif;
        endif;

        if (
    $wpfp_before):
            echo 
    "<p>".$wpfp_before."</p>";
        endif;

        echo 
    "<ul>";
        if (
    $favorite_post_ids):
            foreach (
    $favorite_post_ids as $post_id) {
                
    $p get_post($post_id);
                echo 
    "<li>";
                echo 
    "<a href='".get_permalink($post_id)."' title='"$p->post_title ."'>" $p->post_title "</a> ";
                
    wpfp_remove_favorite_link($post_id);
                echo 
    "</li>";
            }
        else:
            echo 
    "<li>";
            echo 
    $wpfp_options['favorites_empty'];
            echo 
    "</li>";
        endif;
        echo 
    "</ul>";
        
    wpfp_clear_list_link();
        echo 
    "</div>";
        
    wpfp_cookie_warning();
    ?>
    Intended outcome

    Code:
    <div class="post-box"> 
        <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to &#37;s', 'portfoliopress' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark" style="font-family:Arial;font-size:12px;font-weight:bold;"><?php echo ShortenText(get_the_title()); ?>
        <BR />
        <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'portfoliopress' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
        <div style="height:116px;overflow:hidden"><img src="<?php echo get_post_meta($post->ID, 'custom_field_1', true); ?>" /></div></a>
        
        </div>
    Last edited by Master00; 05-13-2011 at 11:05 AM.

  2. #2
    Join Date
    Apr 2007
    Posts
    1,664

    Mailing list

    I need to set up an address to use as a single send to that will go to a mailing list of people who subscribe to it.

    I'm fine with the list management side of it but am not good with MX stuff. Anyone seen a useful tut on how to do this?
    Anti Linux rants are usually the result of a lack of Linux experience, while anti Windows rants are usually a result of a lot of Windows experience.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles