Forum Replies Created

Viewing 13 replies - 16 through 28 (of 28 total)
  • Thread Starter GaryKay

    (@garykay)

    Hi keesiemeijer,

    Thank you for the help, works perfectly.

    Forum: Fixing WordPress
    In reply to: SQL Injections
    Thread Starter GaryKay

    (@garykay)

    Thank you Esmi

    Forum: Plugins
    In reply to: Wiki plugin
    Thread Starter GaryKay

    (@garykay)

    Thank you WPyogi

    Forum: Fixing WordPress
    In reply to: Dual registration
    Thread Starter GaryKay

    (@garykay)

    Thank you krishna, I will look into it

    Forum: Fixing WordPress
    In reply to: Loop offset by 1
    Thread Starter GaryKay

    (@garykay)

    Hi alchymyth,

    Thank you for your reply. That is the code, it works as you can see, but from your comment it seems wrong.

    I have tried ‘post__not_in’ method , I found it here. I will go study the codex.

    Thank you.

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    Thanks Lee,

    Will take that advise and implement it

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    Hi Lee,

    This is what I eventually did and it works as needed.

    <?php
    /*
    Template Name: Property 1
    */
    get_header(); ?>
    
     <div id="content" class="col-full">
    
          <div id="main-sidebar-container">    
    
                <!-- #main Starts -->
                <?php woo_main_before(); ?>
                <div id="main">
    				<?php 
    
    							// WP_Query arguments
    						$args = array (
    							'post_type' => 'property',
    							'pagination'             => true,
    							'posts_per_page'         => '6',
    							'offset'				=> '4',
    							'orderby' => 'date',
                                'order' => 'ASC',
    							'tax_query' => array(
    							array(
    								'taxonomy' => 'category',
    								'field' => 'slug',
    								'terms' => 'uncategorized'
    							)
    						)
    						);
    
    						// The Query
    						$property = new WP_Query( $args );
    
    						// The Loop
    						if ( $property->have_posts() ) {
    							while ( $property->have_posts() ) {
    								$property->the_post(); ?>
    
    								<?php if (in_category(array('sold'))) { ?>
    											    <div id="u<?php the_title(); ?>" class="sold">
    											      <img src="<?php the_field( "property_sold" ); ?>">
    											    </div>
    								<?php } else { ?>
    											<a href="#<?php the_ID(); ?>" id="u<?php the_title(); ?>"  name="modal" class="available">
    											      <img src="<?php the_field( "property_available" ); ?>">
    											</a>
    									<?php } ?>
    
    									<div id="boxes">
    
    									<div id="<?php the_ID(); ?>" class="window">
    										<div class="window_left">
    											<h2>Unit <?php the_title(); ?></h2>
    											<p><?php the_field( "floor" ); ?></p>
    											<p><strong>Beds:</strong> <?php the_field( "beds" ); ?></p>
    											<p><strong>Baths:</strong> <?php the_field( "baths" ); ?></p>
    											<p><strong>Estimated Levy:</strong> R<?php the_field( "levy" ); ?></p>
    											<p><strong>Internal Area:</strong> <?php the_field( "area" ); ?>m&sup2;</p>
    											<p><strong>Patio Area:</strong> <?php the_field( "patio" ); ?>m&sup2;</p>
    											<p><strong>Courtyard Area:</strong> <?php the_field( "courtyard" ); ?>m&sup2;</p>
    											<p><strong>Total Area:</strong> <?php the_field( "total_area" ); ?>m&sup2;</p>
    											<hr>
    											<p><strong>Price:</strong> R<?php the_field( "price" ); ?></p>
    											<hr>
    											<a href="<?php the_field( "unit_pdf" ); ?>" target="_blank" class="pdf_download">Unit layout.pdf</a>
    
    											<img src="<?php the_field( "position" ); ?>">
    										</div>
    										<div class="window_right">
    											<img src="<?php the_field( "unit_plan" ); ?>">
    										</div>
    									<a href="#"class="close"/>X</a>
    									</div>
    
    									<!-- Mask to cover the whole screen -->
    									  <div id="mask"></div>
    									</div>
    
    											  <?php
    						}
    					}
    				?>
    
    <div id="floorplan_bg">
    
    		<img src="<?php bloginfo('template_url'); ?>/../canvas-child/imgs/upton_first.jpg">
    
    </div>
    </div><!-- /#main -->
                <?php woo_main_after(); ?>
    
                <?php get_sidebar(); ?>
    
        </div><!-- /#main-sidebar-container -->         
    
        <?php get_sidebar( 'alt' ); ?>
    
        </div><!-- /#content -->
    
    <?php get_footer(); ?>

    http://ashburn.co.za , check out the first floor ect.

    Thank you so much for your input

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    It’s installed on a local test site, I will create a dev site and share the link with you.

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    HI Lee,

    Thank you for the above script. I created a new template and inserted the code above and got the same result. I think I will need to go another route for now but will keep on working on this and if I find a solution I will share.

    Thanks for your time

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    Hi Lee,

    Thanks for the reply. The 10 posts are displayed on a page, when you click on the post it would normally take you to a single page. I would like it to rather display in a modal window (clients request). If I inspect the page in Chrome, I can see that each post has a different id, which is great. All I’m trying to do is display that single post in a modal window and not a single page. I was hoping that the variable $myid would carry the post id into the script I have located the the modal window (I have jQuery set in the header.php). The modal window display correctly, but with the last post and not the post that has been selected, clicked on. I appreciated your help this far.

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    <?php
    /*
    Template Name: Property Flo
    */
    get_header(); ?>
    
    <div class="container">
    
    <div class="row">
    
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <h2 class="page_title"><?php the_title(); ?></h2>
    
    </div>
    
    </div>
    
    <div class="container">
    
    <div class="row">
    <?php 
    
    // WP_Query arguments
    $args = array (
    'post_type' => 'property',
    'pagination'             => true,
    'posts_per_page'         => '10',
    'offset'				=> 0,
    'tax_query' => array(
    array(
    'taxonomy' => 'category',
    'field' => 'slug',
    'terms' => 'uncategorized'
    )
    )
    );
    
    // The Query
    $property = new WP_Query( $args );
    
    // The Loop
    if ( $property->have_posts() ) {
    while ( $property->have_posts() ) {
    $property->the_post(); ?>
    
    <?php if (in_category(array('sold'))) { ?>
    	<div id="p<?php the_title(); ?>" class="sold">
    	  <img src="<?php the_field( "property_sold" ); ?>">
    	</div>
    <?php } else { ?>
    <a href="#dialog" name="modal">
    	<div id="<?php $myid = the_ID(); ?>"  class="available">
    	  <img src="<?php the_field( "property_available" ); ?>">
    	</div>
    </a>
    
    <div id="boxes">
    
    <div id="dialog" class="window">
    <?php
    				$my_postid = $myid;//This is page id or post id
    				$content_post = get_post($my_postid);
    				$content = $content_post->post_content;
    				$content = apply_filters('the_content', $content);
    				$content = str_replace(']]>', ']]>', $content);
    				echo $content;
    ?>
    <a href="#"class="close"/>Close it</a>
    </div>
    
    <!-- Mask to cover the whole screen -->
      <div id="mask"></div>
    </div>
    
    <?php } $myid = the_ID(); echo $myid;?>
    
    <!-- If I echo the $myid from the id attribute it does not echo but if I echo from between the above delimiters it does echo. So, the $myid in the id attribute does not do any thing. I also changed the id attribute to reflect the ID of the post. The $myid below there also does nothing, if I replace it with the actual interger it works.-->
    
      <?php
    }
    }
    ?>
    
    </div>	
    
    </div>
    
    <?php // comments_template(); ?>
    
    <?php endwhile; endif; ?>
    
    </div>
    
    <!-- MODAL WINDOW -->
    
    <!-- END OF MODAL WINDOW -->
    
    </div>
    
    <?php get_footer(); ?>

    This is my complete script. I’m trying to get the variable $myid to collect the id of the post and display that post in a modal window. If you can help I would appreciate it

    Forum: Fixing WordPress
    In reply to: my_postid
    Thread Starter GaryKay

    (@garykay)

    Hi Lee, I have a custom post type which I have populated with entries. I want to display the single entry in a modal window and not a single page(If that make sense?). I will try your suggestion and revert back to you. Thank you for your response.

    Thread Starter GaryKay

    (@garykay)

    Thank you Paul

Viewing 13 replies - 16 through 28 (of 28 total)