Jump to content

koon0789

New Members
  • Posts

    4
  • Joined

  • Last visited

koon0789's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have dynamic images that have the "Like" button, it's basically like a wishlist. The way I want it to work is that when a user is not logged in, the 'Like' button will navigate them to a login popup (which I already made). This is my code for the sign in/register <?php if(isset($logged_user)){ ?> <a href="<?php echo SITE_URL; ?>user/account" id="namebutton">Hello, <?php echo ucfirst($logged_user->first_name); ?></a> <a href="<?php echo SITE_URL; ?>user/logout" id="logoutbutton">Log Out</a> <?php }else{ ?> <a class="loglink" href="javascript:void(0)" onclick="toggle_visibility('popupBoxTwoPosition');">Sign in</a> <a class="reglink" href="javascript:void(0)" onclick="toggle_visibility('popupBoxOnePosition');">Register</a> <?php } ?> This is my code for the Like button: <?php if(count($model->wish) > 0){ ?> <a href="<?php echo SITE_URL; ?>category/wishlist_delete?id=<?php echo $model->wish{0}->id; ?>"><img src="<?= SITE_IMG ?>heart_icon2.png" alt="hearticon" class="hearticon2" /></a> <?php }else{ ?> <a href="<?php echo SITE_URL; ?>category/wishlist_post?id=<?php echo $products{0}->id; ?>"><img src="<?= SITE_IMG ?>heart_icon4.png" alt="hearticon" class="hearticon4" /></a> <?php } ?> How do I combine the two if statements together?
  2. After days of agony, I finally figured out a way to display my blog posts masonry style. However, I now want to find out if I can make it look exactly (or close to) the static design that I had before which is this : http://pier36nyc.com/events/ How my dynamic masonry looks like right now on my localhost: http://postimg.org/image/uy5jb4zax/ This is the code for the masonry: <script> jQuery(document).ready(function($){ var $container = $('#container').masonry(); $container.imagesLoaded( function() { $container.masonry({ isFitWidth: true });; }); console.log ('JQuery Works'); }); </script> =========== <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="box"> <div class="holder"> <!-- this is JQuery class --> <?php if ( has_post_thumbnail() ): ?> <?php echo the_post_thumbnail(); ?> <?php else: ?> <?php echo the_content(); ?> <?php endif; ?> <div class="info"> <!-- this is JQuery class --> <p class="title"><?php the_title(); ?></p> <p class="caption"> <?php if ( has_excerpt() ) : ?> <?php the_excerpt(); ?> <?php endif; ?></p> <a href="<?php the_permalink() ?>"><input class="button1" type="button" value="VIEW EVENT" /></a> </div> </div> </div> <?php endwhile; endif; ?> =================== The way my dynamic masonry look like that (I think) is because on the Php Code, it wraps every post in an individual class, hence giving it the same width. I feel like I need to tweak the logic, such as dividing posts into two categories : 'rectangle' and 'square', so that when the code generates the masonry, it will output the blocks in different shapes depending on the random generator. Can you guys help me out with this one? My knowledge in JQuery and PHP is very basic. I'm good at HTML and CSS but still learning JQ/PHP.
  3. Hey guys, I am new here to this forum as well as web development. I have created my first website which is pier36nyc.com My only problem so far is trying to make the events page dynamic. http://pier36nyc.com/events/ If you take a look at the events page, there is a gallery of pictures which display a title, caption, an image, and a button link when you hover above it. The problem is, all of that is static for now. The code for that is on my 'Pages' section where I just HTML everything in there. I also used JQuery for the hover effect. How do I make this gallery dynamic so that when a user wants to create a block, there will be a tool (which I think I will have to create through PHP, which I need help from you guys) that allows the user to input the desired Title, Caption, Image, and Link to that block. The problem is: I have very minimal knowledge in PhP. I'm interning right now and learning everything all at once. I'm losing my mind right now >_< I know it's not as complicated as I try to make it sound. But I'm just stressed out Can someone please help me out? I would greatly appreciate it..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.