Category : wordpress

In my project there is a section: favorite. On posts there is a button to add to favorites when you click on this button,the post ID put on the current user metadata. This is the button code: <span data-post-id="<?php the_ID(); ?>" data-user-id="<?php echo $current_user->ID; ?>" class="receipt_favorites"></span> Here is the Jquery for ajax: jQuery(‘.receipt_favorites’).on(‘click’,function(e){ var postID ..

Read more

This is the code: add_shortcode( ‘tpmfaq’, function ($attr) { $args = shortcode_atts( array( ‘col1’ => ”, ‘srow’ => ”, ‘erow’ => ”, ‘page’ => ‘A’, ), $attr ); require("reader.php"); $file="/nas/content/live/tpm20/wp-content/themes/agentpress-pro/testFAQ.xls"; $connection=new Spreadsheet_Excel_Reader(); $connection->read($file); $startrow=$args[‘srow’]; $endrow=$args[‘erow’]; $col1=$args[‘col1’]; for($i=$startrow;$i<$endrow;$i++){ $value = $connection->sheets[0]["cells"][$i][$col1]."<br>"; return $value; } }); It uses the excel PHP library from http://metinerbek.com/article/get-data-from-excel-with-php I need to ..

Read more

I have the following code: homepage.php <?php $query = new WP_Query( array( ‘order’ => ‘ASC’, ‘orderby’ => ‘menu_order’, ‘post_type’ => ‘work’ ) ); ?> <?php get_template_part(‘loop’, ‘feed-work’); ?> <?php wp_reset_query(); ?> loop-feed-work.php <?php if($query->have_posts()) : ?> <?php while($query->have_posts()) : $query->the_post(); ?> <?php the_title(); ?> <?php endwhile; ?> <?php endif; ?> But when I view my ..

Read more

I’m trying to make my own appointment system for WordPress. For this, I created a post type called "appointments". When users select a service from the service list, the available dates and times are listed. When the available date and time are selected and the appointment is created, a meta key named "appointment_datetime" is added ..

Read more

I want to make a custom blog with filter and search function in my WordPress template. This is what the UI should look like: I have a page named "blog" and a template file named "page-blog.php". In that template file I’m using WP_Query with $args ‘category_name’ => ‘blog’, to display all posts of the category ..

Read more