• Until recently have I fiddled with passing wordpress’s variables through flash for either headline widgets or front page widgets like breaking news headline scrollers at the top of pages, etc.

    I’ve developed a .swf file that loads the wordpresses headline via the <? php get_post title, something on the lines of that. That gets tossed through the flash file, all is said and done.

    However when trying to specify what post title gets tossed through (e.g. from a category), is where I fall off the bandwagon. Developing front page widgets for my wordpress run websites is alright with just php, but getting just the straight flat text of something (like in this case the headline of an article, or multiple articles from said category) is where I get lost. Any ideas?

    An example of what I’m attempting to do is to pass the latest posted article from a specified category through flash so, the only “text” the flash .swf file would see with the wordpress variable would be just the headline. I would then be able to take that text in flash, and play with it, animate it if needed and develop widgets, etc.

    This also goes with from a specified category getting the latest posted article’s URL as well, so that the widget can link up to the headline of that article as well.

    I completely suck at explaining things, I’m use to be just shoved in a corner and told to code, so if this makes sense to anyone please help 🙂

    Thanks all, and from a code monkey to another…assistance would be greatly appreciated 🙂

    ~Brian

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter phrozen755

    (@phrozen755)

    no biters eh?

    having trouble understanding the crux of your problem

    One observation that might assist is that many wordpress tags want to print/echo out the return value immediately. In many cases you can prevent this by passing a value to the tag. eg:

    $flashvariable = the_title();

    wont work as the the_title will print out as soon as its encountered – $flashvariable cant be manipulated.

    $flashvariable = the_title('before', 'after', FALSE);

    works as $flashvariable can now be manipulated in PHP to prepapre for its insertion into flash. (before, after can be changed or set to empty)

    Perhaps better than that there are also other tags that are better designed for returning values to PHP. eg

    • the_title_attribute() rather than the_title()
    • get_permalink() rather than the_permalink()
    Thread Starter phrozen755

    (@phrozen755)

    Thanks for the reply zeniph 🙂

    But when it comes to a tags, what other wordpress tags are there that would return values via something like -> <?php the_title(); ?> or, for custom fields -> <?php $values = get_post_custom_values(“byline”); echo $values[0]; ?>

    What other kind of tags can I use to spit out data like the above php code? How about getting the author of a post?

    I’m hopefully going to get to my final solution which is to get 3 to 5 posts from wordpress into a flash-based widget which runs off of the above php tags instead of building a flash widget that runs off of RSS.

    Thanks again!

    **edit**

    Just found my holy grail: http://codex.wordpress.org/Template_Tags#Author_tags

    😀

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Flash with wordpress php variables’ is closed to new replies.