Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » New Versions, & Updating »

[SOLVED] Workaround for PHP: <?php the_permalink() ?>


  #1  
Old Oct 14, 2011, 01:58 AM
damian
 
22 posts · Feb 2010
[SOLVED] Workaround for PHP: <?php the_permalink() ?>

Now that PHP is no longer allowed in Atahualpa theme options, I need a workaround. Can anyone suggest a substitute for the following?

<?php the_permalink() ?>

I have a bunch of social media buttons (Facebook, Twitter, Digg, etc.) that require permalinks for blog posts on multi-post pages.

Please note that I'm almost a total newbie when it comes to coding, so I need everything spelled out explicitly.

Thanks in advance for your help!
  #2  
Old Oct 14, 2011, 03:46 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
If you need the php in a post, page or widget, you can use the exec-php plugin which allows php in those areas. It is just themes that aren't allowed to use it.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Oct 14, 2011, 02:31 PM
damian
 
22 posts · Feb 2010
Quote:
If you need the php in a post, page or widget, you can use the exec-php plugin which allows php in those areas. It is just themes that aren't allowed to use it.
I should have been more clear: I'm talking about PHP in Atahualpa Theme Options->Posts & Pages->Edit POST/PAGE INFO ITEMS->BYLINE: Homepage (for example).

Can PHP be executed from that section, or not?

I just installed the Exec-PHP plugin you suggested, and it still doesn't seem to be executing PHP, when included in the section I just indicated.

It would be a major, major pain to have to manually insert a bunch of html and php in every single blog post, which is why I'm trying to use Atahualpa Theme Options->Posts & Pages->Edit POST/PAGE INFO ITEMS->BYLINE: Homepage.

Is there a way to get PHP to execute in this section, or is there a workaround so I can implement social networking buttons that refer to permalinks and titles for individual posts on multi-post pages? Here is all of the PHP I'm trying to execute:

<?php the_permalink() ?>

<?php echo get_permalink(); ?>

<?php the_title() ?>

<?php $link = get_permalink(); echo urlencode($link); ?>

<?php $title = get_the_title(); echo urlencode($title); ?>

<?php related_posts() ?>
  #4  
Old Oct 14, 2011, 02:53 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
You can add a new widget area in those spots and then us a php aware widget in it.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Oct 14, 2011, 02:55 PM
damian
 
22 posts · Feb 2010
Great! Thanks!

I've never created a new widget area or used a PHP aware widget before. Would you mind pointing me in the right direction?
  #6  
Old Oct 14, 2011, 08:42 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
The instructions for adding a new widget area are in the Add New Widget Areas section of the theme options. To find a php aware widget you can search wordpress.org. For example I searched for php widget and came up with this one. So the steps are.
  • Add a New Widget Area per the instructions in ATO>Add New Widget Areas
  • Go to Appearance>Widgets and drag the php widget into the newly created widget area
  • Put the PHP code in the widget
I would suggest playing with these steps in a test site to get familiar with the steps.
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.

Bookmarks



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bug with WP-Email Plugin – Workaround? damian Plugins & Atahualpa 2 Apr 18, 2011 03:26 PM
[SOLVED] I want my Front Page to be my Posts Page with a tab. Workaround? Hidden Driveways Page & Category Menu Bars 2 Jul 10, 2010 10:17 AM
[SOLVED] Buddypress Workaround for Single WP Install? Rashell Sidebars & Widgets 1 Mar 12, 2010 11:20 AM
WP-PostViews workaround? perdox808 Post-Kicker, -Byline & -Footer 0 Apr 10, 2009 09:57 AM


All times are GMT -6. The time now is 05:02 PM.


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