Build Your Own Business Website header image

Welcome to our Members Only Forum

You are welcome to view the content on our Forum, just scroll down to view this forum post.
If you like what you find and want to be able to post a question, please check out our subscription options.
Please feel free to search the forum using either the Google Site Search above or the forum search below.

Avatar
Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
aligning background image with php
Avatar
Ronen Laviv
Jedi
Members

Community Member
Forum Posts: 251
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline
1
December 14, 2013 - 2:36 pm
sp_Permalink sp_Print

Hi Rick,

 

I was trying to add a members only image to the top right corner of each excerpt,  to the top left of the featured images while the featured image "goes to back" and the stamp "goes to front". I'm not sure if the background can float over an image... if it can't, I guess I'll have to settle with putting it in the right corner, below the text.

I'm trying to overcome two issues:

1. How to structure that correctly

2. How to show the image and not the code as it shows now.

 

While wishlist team is looking at fixing the API, I went a head and added this code to the custom.php:

 

function byob_add_protected_message(){
     global $post;
     $post_id = $post->ID;
     //if(wlmapi_is_protected($post_id)){  <-- waiting for a fix
         ?>background-image:url('http://www.appgo2market.com/wp.....&#039;);<?php
     //}
 }
// Site too slow with current solution. Also current solution doesn't work
add_action('hook_top_app_post_footer', 'byob_add_protected_message');

 

Thanks,

R.

Avatar
Rick Anderson
Desert Hot Springs, CA
Admin
Forum Posts: 13637
Member Since:
November 8, 2009
sp_UserOfflineSmall Offline
2
December 15, 2013 - 8:10 am
sp_Permalink sp_Print

I do something very similar to this.  Depending on the logged in status of the user and depending on the availability level of the video I display a green, yellow or red check box beside the video titles.

Your interest is only in displaying a "members only" image for any protected post.

If the api doesn't work properly (and it doesn't surprise me that WLM is slow) then you could use a simpler system using a custom taxonomy (or a custom post meta) for "availability".  Custom post meta might actually work easier.

Then use the post meta fields extended box to specify the image to display.

This would make a good Wednesday demonstration.

Avatar
Ronen Laviv
Jedi
Members

Community Member
Forum Posts: 251
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline
3
December 15, 2013 - 8:28 am
sp_Permalink sp_Print

Thanks Rick,

I think I wasn't able to explain myself well:

I assume that wishlist team would fix that.

While I'll be happy to watch the alternative to the API function- in this thread I'm after how to handle the image (assuming the API is handled by wishlist).

So, If we disregard the API code, and talk about css inside php (or any other option that would allow stamping the excerpts with the "Members Only" background:

With appgo2market.com, I wasn't sure if a "Stamp" can be placed on top of "Everything" and cross container borders, or set a background in the right place. The question is actually how to use the image to "Stamp" excerpts.

The two problems I encountered:

1. Using CSS in the php didn't work - it just printed the text of the css, and didn't execute it.

2. Even if CSS worked, I'm not sure if and how , the membership image can override ("Bring to Front" on Microsoft Word) other excerpt images or text. My preference was to put a "Stamp" picture that is partially over the featured image top left part. If that can not be done, I was wondering how to put it on the top right part, by the title, and make sure it works well with mobile as well.

 

If that's what you meant in your above answer, I'll do my best to join on Wednesday.

 

Thanks,

Ronen.

Avatar
Rick Anderson
Desert Hot Springs, CA
Admin
Forum Posts: 13637
Member Since:
November 8, 2009
sp_UserOfflineSmall Offline
4
December 16, 2013 - 1:50 pm
sp_Permalink sp_Print

Do you have a "members only" graphic?

Avatar
Ronen Laviv
Jedi
Members

Community Member
Forum Posts: 251
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline
5
December 16, 2013 - 1:53 pm
sp_Permalink sp_Print

No, the API answers the is_protected question.

Currently I have a function that works. You can see on my site that I have a text (from the PHP) "Member Only" on the candy crush post above the image (appgo2market.com).

 

It become a question of css how to style from a PHP, how to add images on top of areas as a stamp.

 

R.

Avatar
Ronen Laviv
Jedi
Members

Community Member
Forum Posts: 251
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline
6
December 19, 2013 - 11:15 pm
sp_Permalink sp_Print

I might have not understood your above question.

I do have an image of "members only" graphic I'd like to use, sure. I just don't know how to use that from a php file with the correct css settings, as everything I "echo" or close php to open html "?>" is being treated by the browser as text, and not as css commands.

 

Until you conduct the mini seminar that addresses all angles of customizing fields, may I ask your assistance on this thread with guidance about the php only. A short example that would allow me to try out - one that shows how css can be applied from a php that is called with a hook on the excerpt box.

 

Thanks & Happy holidays,

Ronen.

Avatar
Ronen Laviv
Jedi
Members

Community Member
Forum Posts: 251
Member Since:
November 1, 2013
sp_UserOfflineSmall Offline
7
December 20, 2013 - 4:07 pm
sp_Permalink sp_Print sp_EditHistory

I think I got it.

 

I had to add to the php:

$message = $something . '<div class="some_class">' . "somethingelse" . '</div>';

echo $message;

 

And from here custom.css can apply…

Avatar
Rick Anderson
Desert Hot Springs, CA
Admin
Forum Posts: 13637
Member Since:
November 8, 2009
sp_UserOfflineSmall Offline
8
December 24, 2013 - 10:07 am
sp_Permalink sp_Print

Ronen - I'm sorry about the delay in getting back to you.  I've been travelling the last few days.

It does look like you've kind of got it.  I will still be doing a seminar on this because the concept is useful.

Forum Timezone: America/Los_Angeles

Most Users Ever Online: 228

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Keith W Jones: 1428

Brian Tozer: 1004

Carolin: 982

Heidi Hafner: 508

John Cunningham: 423

Reece Morrel: 353

Newest Members:

emma62755

sharonmarks

emma80233

Tijs de Jong

Daniel Frey

mutek

Forum Stats:

Groups: 8

Forums: 46

Topics: 6995

Posts: 34796

 

Member Stats:

Guest Posters: 6

Members: 6761

Moderators: 2

Admins: 2

Administrators: Rick Anderson, Rick Anderson

Moderators: Pierre Cote, Laura Nugent