Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all 8245 articles
Browse latest View live

lingz on "Permalink rewrite breaks on using custom taxonomy at the root"

$
0
0

Hi All,

I've created a plugin (An Issue Manager), that in-part, adds a possible rewrite to the post permalink with a custom taxonomy using /%issue%/ in the permalink structure. However, when I do this, it breaks support for pages, and they all show up as not found. This is not the case with categories / tags though.

Is this an oversight in wordpress or is there some workaround.

If you want to see the code, the pertinent parts are the first 50 lines found here:

https://github.com/lingz/issuer/blob/master/issuer.php

Thanks


kitcorsa on "Direct Required - Flooring Site - E-commerce/booking"

$
0
0

Im looking for a bit of advice or direction here,

Im looking to make a site for my brother who is specialist flooring expert who can supply fit and repair floors. What i'm after doing is creating a restoration site for him which explains how he resorted and repairs old wood floors and preserves them. this part is straight forward enough etc, the wall i'm hitting and getting stuck on is an online quote / booking system which could have a payment (paypal option)

This service is fairly straight forward as my brother charges a set price per square meter, so what i'm trying to do is create a form where the customer can enter the width and length of there room, and get a quote, then send a booking email to my brother with the same information for my brother to contact them and arrange the appointment to go round, inspect and perform the job.

The next problem is what if the customer has more than one room?? is there a way of adding a room 2 room 3 etc etc etc if required.

We have also though about taking an online deposit via paypal for say 10%, we would not be able to take the full amount as the customer may enter the wrong size trying to get a cheaper job done, or over changed by not measuring correctly. Deposit first and final payment on completion would be better if possible.

Could anyone please point me in the right direction please. Thank you

stefan2k on "iCal feed - trigger outlook sync"

$
0
0

Hello everybody!

I provide an iCal file within an wordpress feed. In the admin panel the user can set some settings for this file (which events, time restriction etc...).

    The problem:
changed settings (for example exclusion of a post type) are not synchronized until a new post is published.
    What I already tried:
I tried to re-generate the ical file when settings are changed but outlook still does not syncs as there are no new posts.

I tried to post and delete a "dummy-post" which again does not trigger a synchronization except one skips the delete.

I'd appreciate any hints as how to manually trigger an outlook synchronization on admin-option update.

Thanks in advance,
Stefan

tunescool on "Move Button In Posting Page And Add Return Function"

$
0
0

i use this to add a button in my posting page

// add more buttons to the html editor
function wptit_add_quicktags() {
?>
    <script type="text/javascript">
    QTags.addButton( 'wptit_pre', 'Gallery', '<a href="http://url.com" target="_blank">See The Full Gallery Here</a>', '', 'g', 'See The Full Gallery tag', 1 );
    </script>
<?php
}
add_action( 'admin_print_footer_scripts', 'wptit_add_quicktags' );

someone helped me on another forum but didnt do everything i wanted

i want the button the last button, all the way on the rite, its the first button now

i want the button when hit to add the return key, as if the return has been hit and then this html

See The Full Gallery Here

if i have the cursor after the g's, highlite the rest, and hit the button

gggggggggggggggghhhhhhhhhhhhhhhhh

this is what the button does

gggggggggggggggg
See The Full Gallery Here

return and it goes to a new line and the html is added

mrfraz on "Show second tag"

$
0
0

I have a code-snippet on my site to show the last second tag.

<?php
$posttags = get_the_tags();
$count=0;
if ($posttags) {
  foreach($posttags as $tag) {
    $count++;
    if (2 == $count) {
	echo '<a href="http://www.xyz.com/' . $tag->slug . '" alt="' . $tag->name . '" title="' . $tag->name . '">' . $tag->name . '</a>';
    }
  }
}
?>

i include this.. on the tag-page..

18 sites... and on one... it is the wrong tag.
i can't find the bug... is it in the database?

thanks for help.

Zion Eye Media on "Custom Fields in Media Library Attachments"

$
0
0

I've searched and searched for code (no plugins) to add custom fields in media library attachments. I finally found something that may work for those searching for it.

Check out this URL: http://www.icprojects.net/adding-custom-fields-to-attachments.html. So far, I have been able to see a custom field column on my media library and have added information on these fields. I have yet to test/try it out (i.e. displaying images on posts/pages based on the custom fields), but am working on a shortcode to make that work. Or maybe to find out that it doesn't work LOL

I'll post my findings soon. Good luck!

pixelpusher01 on "Using Text Widgets"

$
0
0

Hello,
I am new to WordPress. I am using twenty-twelve template. What I would like to do is to use the text widget on my site, however I would like to use different content on each page/sidebar using this widget. As it is now, when I use the text widget I end up with the same text that I have input on all my pages. Is there an easy way to remedy this issue?

WatchTV on "Akismet Can't Login -Comments hacked-not working anymore"

$
0
0

I had comments working then I was getting massive emails, saying mail delivery system, Postmaster notify: see transcript for details, then ALL COMMENTS stopped working saying Oops, no comment with this ID. I am new at wordpress and created near 500 pages that I do not want to lose. More importantly, I do not want to have this situation to get worse, and if I can please get someone to help me I would appreciate all advice. Askimet won't let me login and I do not know why. I also recently got an email saying new user name and password from wordpress that I did not request, with someone elses email. AND I WILL NOT TRY TO LOGIN IN UNDER THIS SUSPICIOUS LOGIN. It would be nice to have comments working again. http://www.watchtv.com thanks in advance....


wilschoy78 on "Auto-Increment User ID based on date"

$
0
0

how to add a auto-increment another user unique id based on date.,

example: if there will be a new user registration it will assign a new user unique ID base on this format Year/Month/Date + autoincrement number
e.g., 20130813001,
20130813002,
20130813003

is there a way to add something like this?

marcelotorres on "How to add field in the column list of images in the gallery tab upload files"

Levy2725 on "Where to place code for a featured post slider"

$
0
0

I'm trying to place a featured post slider in my site between the navigation menu and the first post. I have this code for the plugin:

<?php include (ABSPATH . '/wp-content/plugins/wp-featured-content-slider/content-slider.php');?>

But I'm not sure which template in the Wordpress editor to drop it into and where exactly to place the code so that the slider is displayed where I want it. Obviously I'm in a little over my head.

Any suggestions would be much appreciated.

Aline_rodrigues on "Get Custom Field Image Loop"

$
0
0

Hi everyone, I have this code

<?php
						$imagem = new WP_Query(array(
							'post_type' => 'post',
							'posts_per_page' => -1, //Se deixar em branco ele pega o default do Admin, Deixe -1 para ilimitado
							'meta_key' => 'imagem', //Aqui fica o name do seu custom_field (é o que está no select dropdown)
							'orderby' => 'meta_value', //Deixe assim
							'order' => 'DESC', //Do maior para o menor, mude para ASC se quiser do menor para o maior.
							'category_name' => 'outfits'
						));

						while ($imagem->have_posts()): $imagem->the_post();
						$link = get_post_meta( $post->ID, 'imagem', true );

						    echo '
<ul>';
						    echo '
<li><a href="#"><img src="'.$link.'" width="621"/></a></li>
';
						    echo '</ul>
';

						endwhile
					?>

[Please post code & markup between backticks or use the code button. Your posted code has now been permanently damaged by the forum's parser.]

I wanna that this code return me a imageof custom field in loop. Just one image appear. I wanna + images. How I do this? Thank you.

kn00tcn on "is it possible to make a 'primary' category for wp_nav_menu() to highlight?"

$
0
0

if a post is in multiple categories, is there a way to have the admin select which category is the primary one so that wp_nav_menu() highlights only the primary category instead of all the categories the post is in?

one possible hack is to use a custom field that gets read by javascript to highlight the menu item on page load, but is there a better way?

andymc82 on "password protect site until url variables passed?"

$
0
0

Hi, is it possible to do the following?

1. the site is locked until a url with variables is passed to it.

2. inside the url variables, it should have new userdata (so wordpress will register the user and the user will not need to login again).

e.g URL to pass: http://www.myblog.com?username&pass&name&email&keyToAcessSite

wordpress would then automatically input the data and show the site.

really hope someone can help.

jankowski on "Manual update of post"

$
0
0

Could someone direct me towards the source code (or the function itself) that takes care of updating a post when the "Update Page" button is clicked on the page/post editor? I'm creating a page manually using a PHP script and wp_insert_post(), and the security settings that I've set using the plugin User Access Manager are not being applied. They are applied, however, when I go to the page editor and simply click the "Update Page" button. I would just like the code to do this instead of the WordPress interface.

Unfortunately, including wp_update_post() or wp_publish_post in my code hasn't worked thus far. Would any of you happen to know the function that is called when that button is pressed?

Thanks so much, and apologies if this is the wrong forum!


MarkJ123 on "Newbie: add_action('save_post') Question"

$
0
0

Hi, I am trying to alter some content when a post is created.
In my plugin I am hooking into the WordPress event by calling

add_action('save_post','insert_method')

Where my insert_method is below

function insert_method( $post_id ) {

The issue I am having is that this appears to fire multiple times when a post is created and therefore the code inside the method fires as well.

I have tried to do the following

if ( !wp_is_post_revision( $post_id ) )

but unfortunately it still does not work.

This is my first plugin attempt so I am still learning but any help / advice about how to fix the problem would be appreciated :)

Regards
Mark

briancostea on "Determine cron job status?"

$
0
0

I am creating a cron job that takes a while to perform. Is it possible to have a dashboard that displays the status of the job?

Ideally, I'd like to be able to have the job send a status message to the dashboard.

Thanks
Brian

bjones1985 on "Using Ajax in Wordpress to submit a MailChimp form using MailChimp API"

$
0
0

The problem is my call back function which is mailchimp_submit isn't working. Not sure why. This is what I have.

add_action('wp_enqueue_scripts', 'mailchimp_scripts');

function mailchimp_scripts() {
    wp_register_script( 'mailchimp', get_template_directory_uri().'/inc/plugins/mailchimp-single-sub/js/mailchimp-form-submit.js', array('jquery'), RARE_THEME_VERSION_NUMBER, true );
    wp_localize_script( 'mailchimp', 'myAjax', array( 'ajaxurl' => admin_url( 'admin-ajax.php' )));

    wp_enqueue_script( 'mailchimp' );
}

add_action('wp_ajax_mailchimp_submit', 'mailchimp_submit');
add_action('wp_ajax_nopriv_mailchimp_submit', 'mailchimp_submit');

function mailchimp_submit() {

    require_once __DIR__.'/inc/MCAPI.class.php';
    require_once __DIR__.'/inc/config.php';

    $api = new MCAPI($apikey);

    $subscriberemailID = $_POST["EMAIL"];

    $retval = $api->listSubscribe( $listId, $subscriberemailID, $merge_vars = null );

    echo json_encode($retrval);

    die();

}

// MailChimp form shortcode

add_shortcode("mailchimp-single-sub-print", "mailchimp_single_sub");

function mailchimp_single_sub() {

    echo '<div id="newsletter mc_embed_signup">
            <!-- Begin MailChimp Signup Form -->
            <div id="mailchimp_single_sub_widget_form">
                <div id="status"></div>
                <form class="newsletter-form" action="\" method="post">
                    <h2 class="signup-title">Subscribe to our mailing list</h2>

                    <div class="mc-field-group">
                        <input type="text" name="EMAIL" class="email required" value="" id="mce-EMAIL" placeholder="Email Address">
                        <input type="submit" name="subscribe" id="mc-embedded-subscribe" value="Subscribe" class="btn submit button">
                    </div>
                    <p class="signup-small">Get the latest stories and blogs posts emailed to you each day.</p>
                </form>
            </div>
            <!-- End MailChimp Signup Form -->
            <div class="fix"></div>
        </div><!-- /#newsletter -->';

}

?>

The problem is the function mailchimp_submit is not working. The first file being required is the Mail Chimp API from MailChimp. The second file just includes the account API key and the list ID.

Here is the Js file.

jQuery(document).ready(function($) {
    $('#mc-embedded-subscribe').click(function() { 

        var hasError = false;
        var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

        var email = $("input.email").val();
        if (email == "") {
            alert('This is a required field');
            $("input.email").focus();
            hasError = true;
        }

        else if(!emailReg.test(email)) {
            alert('Please enter a valid email address');
            $("input.email").focus();
            hasError = true;
        }

        if(hasError == true) { return false; }

        $.ajax({
            type: 'POST',
            dataType : 'json',
            url: myAjax.ajaxurl,
            data: {action: 'mailchimp_submit'},
            success: function() {
                $('.mc-field-group, .newsletter-form, .signup-small').hide();
                $('#status').append('Thank you for subscribing.');
            }
         });
         return false;
    });
});

I have been reading the codex and tutorials on this specifically and can't find a solution. If I could get any help would be appreciated.

andymdesign on "add new user with URL variable?"

cimenta on "How to create custom home page via plugin?"

$
0
0

Hi
I want to code a plug-in that creates new custom home page. Note that I have never coded any plug-in before.

1) After activation of plug-in user needs to go to the options of the plug-in and set up that current home page will be replaced by the one that this plug-in generates ( I hope I can code this bit somehow in the future )

2) Plug-in generates custom home page that displays only

- title and body of the latest post
- number of comments

Could someone help me how to code the 2) ?

Currently I have one php file that is very simple plug-in. I can activate / deactivate it but I don't know how to code the home page.

Thank you

R

Viewing all 8245 articles
Browse latest View live