Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Post-Kicker, -Byline & -Footer (http://forum.bytesforall.com/forumdisplay.php?f=17)
-   -   A query on customizing the byline in config to allow external voting for a permalink (http://forum.bytesforall.com/showthread.php?t=391)

stribe Feb 15, 2009 12:01 AM

A query on customizing the byline in config to allow external voting for a permalink
 
Hi all:

That's a rather convoluted long title.. but I was trying to be descriptive as I could be.

What my situation is with this is as follows: I'm attempting to help a blogger friend put in a piece of code in her byline that will allow people to "vote" for the blogpiece at an external aggregator (as mentioned here)

When I was trying to set this up in the configuration for the Atahualpa 3 theme, it looked to me that it would best fit in the Byline:Homepage section. What I've currently got in there is this:

PHP Code:

Posted by %author% on %date('F j, Y, #a#t g:i a')% | <a class="comment-link" href="http://www.progressivebloggers.ca/vote/<?php the_permalink() ?>"> Recommend this at: <img src="http://www.progressivebloggers.ca/wiki/images/2/21/Progblog_small.png" border="0"></a> |

The problem with this is however that when I scroll over it to click on it to vote for her blogpost, I'm getting this:

HTML Code:

http://www.progressivebloggers.ca/vote/<?php the_permalink() ?>
..which is causing me an error, obviously when I click on it to try and vote for it at the external site. What I need is for that last part to actually point it to the actual permalink... i.e. http://www.progressivebloggers.ca/vo...ut.net/?p=1269

So.. I'd like to know what I actually need to put in there so that Atahualpa knows I'm trying to point it at the specific permalink for each different and new blogpost.

Thanks for any assistance.

stribe Feb 15, 2009 10:06 AM

Addenum: I note in Flynn's "to-do" list on here for Version 3.2.1 of this theme, I see he's added the following:

Add post info item "permalink URL of post"

..which is probably directly related to my question. I was going to try to put %link% in where php the_permalink ()?> is located to see if that would list the permanent link in the line for people to be able to vote.. but perhaps thats's not the right syntax.

So.. any other suggestions what bit of php code might work in there?

Flynn Feb 15, 2009 10:09 AM

There's currently no permalink option in the post info items. I'll put it on my todo list and try to get it into the next version

At the moment you would have to find, at the bottom of functions/bfa_postinfo.php

PHP Code:

// images
$postinfo preg_replace_callback("|<image\((.*?)\)>|","image_files",$postinfo);


and right after it add:

PHP Code:

$postinfo .= ' | <a class="comment-link" href="http://www.progressivebloggers.ca/vote/' 
$post_permalink '"> Recommend this at: 
<img src="http://www.progressivebloggers.ca/wiki/images/2/21/Progblog_small.png" 
border="0" alt="" /></a> |'



stribe Feb 15, 2009 12:05 PM

Hi Flynn:

Well, I found that file and added what you suggested, but the code fails to show up on her page either above her posts in the byline or below the posts in the footer.

(Note: I removed that particular code out of her byline and had left it as it was originally, which was:
PHP Code:

<strong>Posted by %authoron %date('F j, Y, #a#t g:i a')% | %edit(' - ''Edit This Post''')%</strong

, because I figured your asking me to add those lines into bfa_postinfo.php would make what I had put into the byline redundant, and possibly show up twice in the byline with one working copy and one that didnt. But, obviously thats not the case).

stribe Feb 15, 2009 12:26 PM

Addenum: I thought maybe the problem was you might have added some extra "." in that code you asked me to add (ie $postinfo.= etc etc) , but removing them didn't fix the issue either.

stribe Feb 15, 2009 02:05 PM

Hi Flynn:

Just for the heck of it, I tried a few other things. I tried changing the part of the code line that reads $post_permalink to this:

PHP Code:

$postinfo ' | <a class="comment-link" href="http://www.progressivebloggers.ca/vote/'.
get_permalink($post_id) . '"> Recommend this at: 
<img src="http://www.progressivebloggers.ca/wiki/images/2/21/Progblog_small.png" 
border="0" alt="" /></a> |'


... as well as just plain old get_permalink() , but neither attempt results in anything showing up on the main page.

So, I've done all that I can here, Flynn. I'm stumped.. unless perhaps there is something that needs to be changed elsewhere (ie in the main index template php file?) for this additional code to work and show up in her byline.

Flynn Feb 15, 2009 04:48 PM

I am sorry, I gave you a slightly wrong place to add the code. Please check the post above again, I've corrected it.

Flynn Feb 15, 2009 04:50 PM

Right now that code would be appended to ANY post footer. You'd have to wrap it into conditional statements to display it only on certain pages.

To display it only on single post pages

PHP Code:

if ( is_single() ) {
$postinfo .= ' | <a class="comment-link" href="http://www.progressivebloggers.ca/vote/' 
$post_permalink '"> Recommend this at: 
<img src="http://www.progressivebloggers.ca/wiki/images/2/21/Progblog_small.png" 
border="0" alt="" /></a> |'




stribe Feb 15, 2009 06:04 PM

Quote:

Originally Posted by Flynn (Post 1516)
Right now that code would be appended to ANY post footer. You'd have to wrap it into conditional statements to display it only on certain pages.

To display it only on single post pages


Actually.. Id like it on all post pages.. both on the front pages and single post and so on.

stribe Feb 15, 2009 06:10 PM

Quote:

Originally Posted by Flynn (Post 1515)
I am sorry, I gave you a slightly wrong place to add the code. Please check the post above again, I've corrected it.


Hi Flynn:

I was going to say that looked exactly like what you sent me before.. but I see now that its below the bracket.. THat appears to have done the trick!!!

Thanks a lot.


All times are GMT -6. The time now is 12:25 PM.

Powered by vBulletin® Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.