Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 1099 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

WordPress coding issue - Mobile Theme

Thread title: WordPress coding issue - Mobile Theme
Reply    
    Thread tools Search this thread Display Modes  
02-29-2012, 02:49 PM
#1
scrappy is offline scrappy
scrappy's Avatar
Status: Member
Join date: Aug 2006
Location: Newcastle upon Tyne
Expertise:
Software:
 
Posts: 172
iTrader: 1 / 100%
 

scrappy is on a distinguished road

Send a message via MSN to scrappy

  Old  WordPress coding issue - Mobile Theme

I'm hoping one of you lovely people can help me with this. I'm trying to develop a mobile version of a friends website for her using WPTouch and I'm having a bit of an issue with the coding.

Her site has a custom field to display a portfolio image for each post. The field is called 'Portfolio Fullsize Image' within the admin panel for WordPress and as far as I can gather in the coding it is '$portfolio_full'.

I have been looking at the coding to try and get the WPTouch theme to display the image at a scaled rate appropriate to the mobile browser.


Within the index.php file we have this:

PHP Code:
<?php if ( wptouch_theme_use_calendar_icons() || wptouch_theme_use_thumbnail_icons() ) { ?>
This then relates to the thumbnails.php file which is currently set with this code:

PHP Code:
<div class="thumbnail-wrap">
    <?php if ( has_post_thumbnail() ) { ?>
        <img src="<?php wptouch_the_post_thumbnail(); ?>" class="attachment-post-thumbnail" alt="post-thumbnail" />
    <?php ** else { ?>
        <img src="<?php echo wptouch_bloginfo'template_directory' ); ?>/images/default-thumbnail.png" class="attachment-post-thumbnail default-thumbnail" alt="post-thumbnail" />
    <?php ** ?>
</div>
I have then looked at the code for the original theme she is using for WordPress which shows this code to display the images (I think):

PHP Code:
<?php
$portfolio_full 
get_post_meta($post->ID'portfolio_full_img'true);
$post_image get_post_meta($post->ID'post_image'true);
$disable_post_image get_post_meta($post->ID'disable_post_image'true);
?>
I've then changed the thumbnail.php file to use this code:

PHP Code:
<div class="thumbnail-wrap">
    <?php if ( has_post_thumbnail() ) { ?>
        <img src="<?php wptouch_the_post_thumbnail(); ?>" class="attachment-post-thumbnail" alt="post-thumbnail" />
    <?php ** else { ?>
        <img src="<?php $portfolio_full get_post_meta($post->ID'portfolio_full_img'true); $post_image get_post_meta($post->ID'post_image'true); $disable_post_image get_post_meta($post->ID'disable_post_image'true); ?>" class="attachment-post-thumbnail default-thumbnail" alt="post-thumbnail" />
    <?php ** ?>
    </div>
Here is the code from the CSS file that relates to the thumbnails:

PHP Code:
.post .thumbnail-wrap {
    
positionrelative;
    
floatleft;
    
displayblock;
    
height46px;
    
width46px;
    
margin-right8px;
**

.
idevice .post .thumbnail-wrap {
    -
webkit-box-reflectbelow 1px 
    
-webkit-gradient(linearleft topleft bottom
    
from(transparent), color-stop(0.8transparent), to(white));
**
.
post img.attachment-post-thumbnail {
    
width46px;
    
height46px;
**

.
idevice .post img.attachment-post-thumbnail {
    -
webkit-mask-box-imageurl(images/thumb-corners-mask.png);
** 

It is however not displaying the image.

I was hoping some people who are good with WordPress could take a look and tell me what they think.

Any help would be very much appreciated.



EDIT: Please excuse the ** symbols, it is replacing parts of my code with this for some reason.

03-05-2012, 03:06 PM
#2
OKcookie is offline OKcookie
Status: I'm new around here
Join date: Mar 2012
Location: okcookie.org
Expertise: Cookie Compliance Solutions
Software: Eclipse,Dreamweaver,Photoshop
 
Posts: 3
iTrader: 0 / 0%
 

OKcookie is on a distinguished road

  Old

Is the Path to the image correct and the folders with the correct permissions?

Reply With Quote
05-10-2012, 08:32 AM
#3
4Templates is offline 4Templates
4Templates's Avatar
Status: I'm new around here
Join date: May 2012
Location: Brentwood, TN
Expertise: Design, Photography, Wordpress
Software: Photoshop, Notepad++
 
Posts: 5
iTrader: 0 / 0%
 

4Templates is on a distinguished road

Send a message via ICQ to 4Templates Send a message via AIM to 4Templates Send a message via Yahoo to 4Templates

  Old

Try that in the thumbnail file

PHP Code:
<div class="thumbnail-wrap">

    <?php 
    
        
if ( has_post_thumbnail() ) { 
        
            echo 
'<img src="';
            
            
wptouch_the_post_thumbnail();
            
            echo 
'" class="attachment-post-thumbnail" alt="post-thumbnail" />';
        
        } else { 
    
            
$portfolio_full get_post_meta($post->ID'portfolio_full_img'true); 
            
$post_image get_post_meta($post->ID'post_image'true); 
            
$disable_post_image get_post_meta($post->ID'disable_post_image'true);
    
            echo 
'<img src="' $portfolio_full '" class="attachment-post-thumbnail default-thumbnail" alt="post-thumbnail" />';
   
        }
        
    
?>
   
</div>

Reply    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed