vendredi 27 mars 2015

Category specific year archive list with desired URL


I am trying to make category specific year archive list.


I tried wp_get_archives() with type=yearly arg in which I got year lists with links.


2015

2014

...


and its link looked like this...

http://ift.tt/1F0GffG

Can I change this to something like

http://ift.tt/1D5Mq4r.


My permalink structure is set to

/%category%/%year%/%monthnum%/%day%/%post_id%/

and my category base is set to

.


Any help appreciated. Thank you for stopping by.





How can I integrate a lightweight payment process in my wordpress site? ¿WPe-Commerce?


I am on a wordpress website that is not a shop, the website offers information in maps. The issue is that the website offers a service of creating legal contracts. The logic is that a registered user gives the personal data, contract data, etc and then the owners of the website make a legal contract.


The point is that this action must be paid by the customers and I want to implement payment process.


I saw that I good option is to use Gravity Form with its payment plugins, but the prices is high.


I saw also that there is another way with WPe-Commerce, but I don't know if it's convenient to use for this purpose.





Dynamically send pdf attached to post with contact form 7 [2]


I'm come from this post : contact form 7


So i do the same exact code :



add_action('wpcf7_before_send_mail', 'my_dynamic_attachments');

function my_dynamic_attachments($cf7) {
$id = $cf7->id();
$upload_dir = wp_upload_dir('2015/03');
if ($id==1326){
$submission = WPCF7_Submission::get_instance();
$data = $submission->get_posted_data();
$pdf = $data['brochures'][0];
//echo $pdf;
$submission->add_uploaded_file('pdf', $upload_dir['path'].'/'.$pdf);
}
}


The problem is if file is sent only i uncomment the "echo". Since he was comment, file not be sent and i don't understand why ...


Have an idea ?


Thanks





I cannot customize custom widgets anymore after moving WordPress website


Originally posted here.


The situation is the following one: A colleague of mine built a WordPress theme with some custom widgets which need to be configured through /wp-admin/widgets.php.


In the local copy that me and him have installed everything works fine (it's the latest WP, the production database and the theme from bitbucket). The production is ok, but it's impossibile to change the widgets options since every widget has a There are no options for this widget. label.


So I did a setup from scratch: I created a new WP-ready droplet on Digital Ocean, imported the database I have locally (1:1 production since I changed my /etc/hosts to point the production domain to my localhost) and cloned the theme, but still I got the same issue of production: Widgets were not customizable. Also there are no references to localhost in wp_option rows.


tl;dr: With the same database and the same files, the website works fine locally while in the production machine (AWS) and in the staging droplet (DO) widgets are not customizable.





Failed to send your message. Please try later or contact the administrator by another method (contact form 7 )


i am new to wordpress . i am facing problem with contact us form. where will be the setting like SMTP or php mail for contact us form (i am using contact form 7 plugin . also i installed wp-smtp. ) i am getting the following error message


Failed to send your message. Please try later or contact the administrator by another method. with red border.


please help me out to solve this issue.





Duplicate slugs in wp Database


While updating a category I keep getting "Item not updated" message, after a little research I found that it is due to duplicate slugs in the database.


I know a slug cannot be duplicated, so now I am wondering how is this possible that database has duplicate entries for slug and how can I get rid of these?


I am using WP-ecommerce categories, where these errors keep coming. enter image description here


You can see the duplicate entries in term_id 27 & 963.





how do i make this loop work


Apologies I am a PHp beginner and I have no idea why this loop is not working on my tag.php page any help would be welcome.



<?php get_header(); ?>
<div class="posts"><!-- BLOG -->

<!-- Shapes on sides -->
<div class="shapes_left"> </div>
<div class="shapes_right"> </div>

<?php if (is_tag()) { ?>
<div id="archive_title">
<h1><?php single_tag_title(); ?></h1>
<?php }?>
</div>


<div id="featured_home">

<?php $counter = 0;
while ( have_posts() ) {
$counter += 1;
if ( $counter > 5 ) {
break;
}
the_post();

?>
<article class="sticky">
<div class="desc">
<div class="desc_over"><h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2></div>
<?php the_post_thumbnail(large); ?>


</div>
</article>
<?php }?>
</div>





<?php while( have_posts() ) {
the_post();
// it's a post! Display the post!
} ?>


<div class="post_main">
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<ul class="postinfo">
<li>Posted by <?php the_author_link(); ?></li>
<li><?php the_time( 'jS F Y'); ?></li>
</ul>

<?php the_content( ''); ?>

<div class="read_more_blog"><a href="<?php the_permalink(); ?>">Read More</a></div>
</div>

<?php endwhile; ?>
<nav id="pagination"> <!-- PAGINATION FOR BLOG -->
<ul>
<li class="older"><?php next_posts_link( 'Older posts'); ?></li>
<li class="newer"><?php previous_posts_link( 'Newer posts'); ?></li>
</ul>
</nav>

</div>
<!-- END OF BLOG PAGINATION -->
<?php else : ?>
<div id="post">
<!-- 404 Messege -->
<h3>404 ERROR!!</h3>

<p>Sorry we can't seem able to find what you are looking for</p>
<p><a href="<?php echo home_url(); ?>">Click here to get back to the homepage</a>
</p>
</div>
<?php endif; ?>
<?php get_sidebar(); ?>
</div>
<?php get_footer(); ?>