Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

How can I get the Gigpress plugin to display 'artist' name? WordPress

  • SOLVED

Hi there,

This sounds like a Gigpress-specific question, but actually may be a general php question (I'm new to both.)

Anyway, Gigpress calls the artist's name with this code:
<?php echo $showdata['artist']; ?>

There are several php files that make gigpress work. (All of these in fact:
[[LINK href="http://cl.ly/65b3130a3705250915eb"]]http://cl.ly/65b3130a3705250915eb[[/LINK]])

The sidebar-list.php file is what displays the artist's shows in this repeatable format (if they have multiple upcoming shows): [[LINK href="http://cl.ly/313aa82cc97b167a53ff"]]http://cl.ly/313aa82cc97b167a53ff[[/LINK]]

The sidebar-list-start.php file displays the artist's name and the header which reads "EVENTS" and precedes sidebar-list.php.

<strong>My question is this: When I have this code: <?php echo $showdata['artist']; ?> in sidebar-list.php, it successfully pulls the artist's name. However, then it also repeats the artist's name (if there is more than 1 show) which is a problem. But when I put the exact same code into sidebar-list-start.php (which doesn't repeat) it no longer works. Why? and how can I fix this?</strong>

So really that <?php echo $showdata['artist']; ?> needs to go into sidebar-list-start.php. However, when I paste that same code (this code: <?php echo $showdata['artist']; ?>) into sidebar-list-start.php, it fails to call the artist's name. There are two other dynamic things in this file as well- the code to call the url to the rss feed and the ical button. Those things both work in the environment of the sidebar-list.php file, but not in the environment of the sidebar-list-start.php file.

Does that make sense? I am pasting the full code for each of these php files down below. Why would the php code work in one file and not the other?

Thanks
Kelli

So this is the current code and this is what it looks like: [[LINK href="http://cl.ly/f7d90332cc7460051282"]]http://cl.ly/f7d90332cc7460051282[[/LINK]]
Where it says "Artist Name" it should actually be calling the artist's name, but isn't.

<strong>sidebar-list-start.php code:</strong>
<div class="content-block">
<h3>events</h3>
<div class="heading-link-box">
<h2><?php echo $showdata['artist']; ?>Artist Name</h2></div>

<div class="heading-link-box">

<div class="shows-table">
<div class="thead">
<div class="cell-date">DATE</div>
<div class="cell-city">CITY</div>
<div class="cell-venue">VENUE</div>
<div class="cell-contry">COUNTRY</div>
<div class="cell-icons">
<ul class="add-ico">
<li><a href="<?php echo get_option('home') ?>/?feed=gigpress&artist=<?php echo $showdata['artist_id']; ?>" class="ico-rss">rss</a></li>
<li><a href="<?php echo get_option('home') ?>/?feed=gigpress-ical&artist=<?php echo $showdata['artist_id']; ?>" class="calendar">calendar</a></li>
</div>
</ul>
</div>





<strong>sidebar-list.php code:</strong>

<div class="row">

<div class="cell-plus"><a href="#" class="ico-plus">+</a></div>
<dl>
<dt>Time:</dt>
<dd><?php echo $showdata['time'] ?>.</dd>
<dt>Admission:</dt>
<dd><?php echo $showdata['price']; ?>$.</dd>
<dt>Age restrictions:</dt>
<dd><a class="item-link" href="#"><?php echo $showdata['admittance']; ?></a></dd>
<dt>Address:</dt>
<dd><?php echo $showdata['address_plain']; ?></dd>
<dd><br />phone: <?php echo $showdata['ticket_phone']; ?>. <a href="#"><?php echo $showdata['notes']; ?>.</a></dd>
</dl>
<div><p></p></div>
</div>


Answers (2)

2010-05-25

Oleg Butuzov answers:

to ensure that showdata has this name just pastate thsi code into sidebar-list-start.php
<?php var_dump($showdata); ?>
very posible that you just need to ask this aviable in some other way...


Kelli Anderson comments:

Hi Oleg,

That didn't work. maybe I'm not pasting it in the right place. This is what the page looks like now- I just get a "NULL": [[LINK href="http://cl.ly/657266fc10311623841b"]]http://cl.ly/657266fc10311623841[[/LINK]]b

Here is what the code looks like so you can see where I pasted it:
<?php var_dump($showdata); ?>
<div class="content-block">

<h3>events</h3>
<div class="heading-link-box">
<h2><?php echo $showdata['artist']; ?>Artist Name</h2></div>

<div class="heading-link-box">

<div class="shows-table">
<div class="thead">
<div class="cell-date">DATE</div>
<div class="cell-city">CITY</div>
<div class="cell-venue">VENUE</div>
<div class="cell-contry">COUNTRY</div>
<div class="cell-icons">
<ul class="add-ico">
<li><a href="<?php echo get_option('home') ?>/?feed=gigpress&artist=<?php echo $showdata['artist_id']; ?>" class="ico-rss">rss</a></li>
<li><a href="<?php echo get_option('home') ?>/?feed=gigpress-ical&artist=<?php echo $showdata['artist_id']; ?>" class="calendar">calendar</a></li>
</div>
</ul>
</div>


2010-05-25

Rashad Aliyev answers:

Hello,

use this code ( <?php $key="artist"; echo get_post_meta($post->ID, $key, true); ?> ) instead of <?php echo $showdata['artist']; ?>.



<?php $key="artist"; echo get_post_meta($post->ID, $key, true); ?>

Waiting for result ;)