go41

custom field not working – $values = get_post_custom_values

von Joern am 13. Jun. 2010 | Keine Kommentare

Joern,
1) I am actually using the Tv Lost theme and the index.php file is as such.
Can you please tell me where I would put your code:
<?php $values = get_post_custom_values("Image"); if (isset($values[0])) { // checks for custom field Image and shows it if there is ?>

" rel="bookmark" title="<?php the_title(); ?>">

<img src="<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="<?php the_title(); ?>" class="alignleft post_thumbnail" width="200px" height="160px" />

<?php } ?>
Within this new index.php file. Can you show me what code I would replace with the above code.
<?php get_header(); ?>
<div id="left_side">
<?php if (have_posts()) : ?>

<?php while (have_posts()) : the_post(); ?>
<div class="post">

<div class="mpart">

<h2>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?> </h2>
<div class="entry">

<?php the_excerpt(); ?>
<?php $values = get_post_custom_values("Image"); if (isset($values[0])) { // checks for custom field Image and shows it if there is ?>

" rel="bookmark" title="<?php the_title(); ?>">

<img src="<?php $values = get_post_custom_values("Image"); echo $values[0]; ?>" alt="<?php the_title(); ?>" class="alignleft post_thumbnail" width="200px" height="160px" />

<?php } ?>

<?php the_content(‚Read the rest of this entry »‘); ?>

</div>
<div class="info"> <span class="time"> <?php the_time(‚F jS, Y‘) ?> </span> <span class="category"> <?php the_category(‚, ‚) ?> </span>

<span class="comments"> <?php comments_popup_link(‚0 Comment‘, ‚1 Comment‘, ‚% Comments‘); ?> </span>

</div>
</div>

</div>
<?php endwhile; ?>
<div class="navigation">

<div class="alignleft"><?php next_posts_link(‚« Previous Entries‘) ?></div>

<div class="alignright"><?php previous_posts_link(‚Next Entries »‘) ?></div>

</div>
<?php else : ?>

<div class="mpart">

<h2>Not Found</h2>

<p>Sorry, but you are looking for something that isn’t here.</p>

<?php include (TEMPLATEPATH . "/searchform.php"); ?>

</div>

<?php endif; ?>
</div>
<?php get_footer(); ?>
2) When I try to write an excerpt, the excerpt shows but I get a blue error image that says "Sorry no image for this property" . I think this is part of the realpress realestate plug in I am using. When I disable this plug in, the error message disappears. I can write the content and use the <read more> stuff to cut off the content and create a link to the entire post, but I am wondering why when I write an excerpt just by putting
<?php the_excerpt(); ?> this horrible blue message occurs. There is some conflict with the real press plug in, I guess.
Wondering if you can see what this could be
2. I want to make the social media icons that are in a div called socialmedia align right on the same vertical plane as the class menu.
Now what I was thinking was putting both of them in a div and floating one to the left and the other to the right. Will that keep them on the same plane? Right now as you can see the social icons are below the menu bar.
3) I want to move the search properties box right next to the Featured content gallery slider, however I can’t find the code or it. If I go to "view source"
I can see that the class it is in is rs
Here is the CSS syntax
.right_side .rs {

float: right;

width: 205px;

margin:0 5px;
Should create a top-margin: 10px;
So it moves up? Can we do that
4) My clients current site is this:
As you can see the top logo.jpg is place on top of another image which is logo)_bg.jpg.
Now, what I was thinking of doing was to create a div
and then have the background be the logo_bg and have it no repeat.
How can I put the logo.jpg image on top of that, do I need a z index setting?
In other words, in a div
if you have the background be an image, how can you add another image superimposing or being displayed on top of the background image.
After I get these answer, we are done ! Thanks so much man!
Omar

(von: omerkhan02)

Hier noch 7 weitere Ergebnisse dieses Threads:

Re: custom field not working – $values = get_post_custom_values :: Reply by master

13. Jun. 2010 (von: master)

1.the code is in the right place - inside the loop.To make it show something the post needs a custom field "Image" and in the value an image path as explained.BUT you have the_excerpt above the image and the_content below,…

Re: custom field not working – $values = get_post_custom_values :: Reply by omerkhan02

13. Jun. 2010 (von: omerkhan02)

you can see the site here:Also my user is adminpassword is igital or Ironman21I am still waiting for you to answer 2 questions.1. How to make the social media icons which are in a div called socialmedia at the same…

Re: custom field not working – $values = get_post_custom_values :: Reply by omerkhan02

13. Jun. 2010 (von: omerkhan02)

Joern, I got the social icons to go on the same plane. As you see there are two instances of them, both were in a div called "SOCIALMEDIA" SO THE SECOND ONE, THAT WAS BELOW THE NAV BAR, I RENAMED…

Re: custom field not working – $values = get_post_custom_values :: Reply by Joern

14. Jun. 2010 (von: Joern)

your socialmedia1 went up because as sicialmedia there is a width:400px; which doesn't fit beside the menu which has 600px already.because you do not have any style for #socialmedia1 in your stylesheet, I cant 'play' with it..try this first:#socialmedia1{text-align: right;}#socialmedia1…

Re: custom field not working – $values = get_post_custom_values :: Reply by omerkhan02

14. Jun. 2010 (von: omerkhan02)

Joern, I understand that no matter what you do within the sidebar.php file, it will remain on the right due to the div. You need to put the php code and div for the real estate search form up where…

Re: custom field not working – $values = get_post_custom_values :: Reply by Joern

14. Jun. 2010 (von: Joern)

as you might see yourself with firebug, the #socialmedia is not recognized somehow.you got a missing '}' here in default css....a {color : #369;text-decoration:none;}/*ADDED A '}' above, you do not have!!!*/#socialmedia1 {....about the search, you are... Weiterlesen →

Re: custom field not working – $values = get_post_custom_values :: Reply by omerkhan02

14. Jun. 2010 (von: omerkhan02)

I Jorge that worked. After putting the closing } it worked by adding the spaces however the socialicons1 div was moved down about 20 px from the menu bar and i couldn't figure out why, but when I used Firebug…

Autor:

Du findest mich auch auf Google+, Twitter und Facebook!

Schreibe einen Kommentar

Pflichtfelder sind mit * markiert.


weitere forum Beiträge: