Forum Replies Created

Viewing 15 replies - 31 through 45 (of 65 total)
  • You are navigating from page.php template to single.php template (or so it sounds). Create a conditional in single.php that if the post is within the boards category show the correct sidebar content.

    does that help?

    Thread Starter shua

    (@shua)

    Any thoughts?

    I use the atom format – place all content within:

    <content type="html" xml:base="<?php permalink_single_rss() ?>"> PLACE CONTENT HERE </content>

    hope that helps

    Thread Starter shua

    (@shua)

    I went ahead and created a fresh install of wp2.5.1 with a brand new db. I created some pages and posts and added a bit of cookie code.

    When navigating to a page with the id of 2 I do this in the header.php

    <?php if(is_page('2')){
         setcookie("myName", 'shua', time()+36000);
    } ?>

    pretty straight forward stuff.

    I then see if the cookie was set using the ‘Cookies’ menu item in FF WebDeveloper extension. Low and behold… it is there.

    I them navigate away from that page, to a page with id 3. I once again look at my cookies… gone.

    What is going on???

    Cookies are turned on, they are set to expire in 10 hours – and cookies from other sites persist?!?

    Thread Starter shua

    (@shua)

    Here is another example of my use of cookies.

    When a user fills in a form I set a cookie for each field.

    When the user navigates to a different form on the site, the fields are pre-populated.

    In wp2.5 the cookie is deleted or lost or destroyed – it is gone.

    Please help.

    Thread Starter shua

    (@shua)

    the fix I found (which kinda sucks) is to use cat=ID rather than category_name=Name

    WOW – this one was killing me!!! thanks for sorting it out so I could reap the benefits!

    best,
    shua

    Thread Starter shua

    (@shua)

    ha! that was the first thing I tried – wp doesn’t seem to like spaces – still didnt work.

    Thread Starter shua

    (@shua)

    it did work exactly as described… but the client wanted more control so we use a custom field and a class to display the ‘New’.

    See this post: http://wordpress.org/support/topic/169652?replies=6

    Thread Starter shua

    (@shua)

    my solution! woo hoo!

    if ( !empty($current_page) ) {
    			$_current_page = get_page( $current_page );
    			if ( in_array($page->ID, (array) $_current_page->ancestors) )
    				$css_class .= ' current_page_ancestor';
    			if ( $page->ID == $current_page )
    				$css_class .= ' current_page_item';
    			if ( get_post_meta($page->ID, 'new', true) == 'Soon' )
    				$css_class .= ' soonVenue';
    			if ( get_post_meta($page->ID, 'new', true) == '1')
    				$css_class .= ' newVenue';
    			elseif ( $_current_page && $page->ID == $_current_page->post_parent )
    				$css_class .= ' current_page_parent';
    		}

    thx for your help Otto!

    Thread Starter shua

    (@shua)

    here is a better url:

    http://www.seesawnetworks.com/explore/categories

    I have a custom field that specifies if the category (page element in wp) is ‘new’ or ‘coming soon’. If the value is ‘new’ then a class is set.

    What I am seeing is that $current_page is not getting a value? so the conditional does not see the custom field value resulting in the class not being set.

    thoughts?

    Thread Starter shua

    (@shua)

    Otto,
    This is how I have been using feeds prior to 2.5:

    in wp-feed.php

    <?php
    
    if (empty($doing_rss)) {
        $doing_rss = 1;
        require(dirname(__FILE__) . '/wp-blog-header.php');
    }
    
    // Remove the pad, if present.
    $feed = preg_replace('/^_+/', '', $feed);
    
    if ($feed == '' || $feed == 'feed') {
        $feed = 'rss2';
    }
    
    if ( is_single() || ($withcomments == 1) ) {
        require(ABSPATH . 'wp-commentsrss2.php');
    } else {
        switch ($feed) {
        case 'atom':
            require(ABSPATH . 'wp-atom.php');
            break;
        case 'rdf':
            require(ABSPATH . 'wp-rdf.php');
            break;
        case 'rss':
            require(ABSPATH . 'wp-rss.php');
            break;
        case 'rss2':
            require(ABSPATH . 'wp-rss2.php');
            break;
        case 'comments-rss2':
            require(ABSPATH . 'wp-commentsrss2.php');
            break;
        case 'overview':
            require(ABSPATH . 'ssn-overview.php');
            break;
        case 'audience':
            require(ABSPATH . 'ssn-audience.php');
            break;
        case 'screens':
            require(ABSPATH . 'ssn-screens.php');
            break;
        case 'creative':
            require(ABSPATH . 'ssn-creative.php');
            break;
        case 'lp_overview';
            require(ABSPATH . 'ssn-lp-overview.php');
            break;
        case 'lp_ditl';
            require(ABSPATH . 'ssn-lp-ditl.php');
            break;
        case 'lp_activities';
            require(ABSPATH . 'ssn-lp-activities.php');
            break;
        case 'lp_research';
            require(ABSPATH . 'ssn-lp-research.php');
            break;
        case 'shortDesc';
            require(ABSPATH . 'ssn-shortDesc.php');
            break;
        case 'eh_overview';
            require(ABSPATH . 'ssn-eh-overview.php');
            break;
        case 'vc_overview';
            require(ABSPATH . 'ssn-vc-overview.php');
            break;
        case 'lph_overview';
            require(ABSPATH . 'ssn-lph-overview.php');
            break;
        case 'lp_relatedVenues';
            require(ABSPATH . 'ssn-lp-relatedVenues.php');
            break;
        }
    }
    
    ?>

    I am not versed in creating a plugin. I have looked at the codex and at some example plugins, but just ‘dont get it’ yet.

    Here is what I am doing in 2.5 (functions.php):

    function do_feed() {
    	global $wp_query;
    
    	$feed = get_query_var( 'feed' );
    
    	// Remove the pad, if present.
    	$feed = preg_replace( '/^_+/', '', $feed );
    
    	if ( $feed == '' || $feed == 'feed' )
    		$feed = get_default_feed();
    
    	$hook = 'do_feed_' . $feed;
    	if ( !has_action($hook) ) {
    		$message = sprintf( __( 'ERROR: %s is not a valid feed template' ), wp_specialchars($feed));
    		wp_die($message);
    	}
    	do_action( $hook, $wp_query->is_comment_feed );
    }
    
    /* Begin SSN Feeds */
    function do_feed_audience() {
    	load_template( ABSPATH . WPINC . '/ssn-audience.php' );
    }
    /* End SSN Feeds */

    What I understand is that the url parameter is passed as a variable to the function call. so do_feed_audience should be called if the requested url is http://www.url.com/postOrPage/?feed=audience.

    What returns is “ERROR: audience is not a valid feed template”

    when I do this:

    $hook = 'do_feed_' . $feed;
    	if ( !has_action($hook) ) {
    		do_feed_audience();
    	}

    The feed is displayed correctly.

    Thoughts??

    Thread Starter shua

    (@shua)

    Thread Starter shua

    (@shua)

    Thx, but I think Ill take the road less traveled.

    PS – when do you think the codex will be updated with 2.5 feed information?

    Thread Starter shua

    (@shua)

    It is not reading what the $current_page is… thoughts?

Viewing 15 replies - 31 through 45 (of 65 total)