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

maxj on "Dropdowns with category and post"

$
0
0

Hi, I need to have to select drop downs, the first one is a category (taxonomy I use for my custom post type) and the other one is all posts (custom post type) in that category. So the other one must be dynamic and change when the category changes, than I need a button that takes me to that choosen post. Is it possible to and how to do that? Does anyone did it before and can give me som advise?


retailmakeover on "Site being redirected to N1canadapharmacy.com"

$
0
0

Any ideas on this one? If I re-install the theme the problem goes away for about an hour and then turns up again. It was being re-directed, now the bug is using the theme page template and replacing the landing page with ad for Premarin. When I did a search on the wordpress.org support I came with this page;
https://wordpress.org/ideas/profile/cheap-premarin-28s-online

Any help appreciated.

Thanks;
Steve

raphadko on "Are there any big issues in changing people's usernames"

$
0
0

I want to completely kill usernames on my website. People will use email for login. I'll do that by duplicating the email field into the username on registration.. but...

When the user changes the email, the username would also change, and since wordpress doesn't allow that by default (even the user update function won't allow it).. I'm wondering if there is any hardcoded reason why that shouldn't happen (external keys or some other architecture restriction).

So my question is: is it safe to make the username field changeable with an email update (obviously by changing the field directly in the database)

rolandd3124 on "Help moving page title outside of styled body"

$
0
0

I am trying to get the page titles at http://www.wordpresswonk.com moved to the left (and outside) the main content area. Right now, the titles are displayed within the main content area and are subject to the same margins (80%). I'd like for the page titles to be to the left more. Can anybody help point me in the right direction with some code?

Thanks!

mebrown26 on "Email collector/call to action with image?"

$
0
0

All I'm trying to do is create a call to action with name and email fields customized with my own images, like the following examples:
marieforleo.com (the black banner at the VERY bottom of the homepage)

OR

this pink box at the bottom of http://conniechapman.com/about/

I CANNOT find a plugin that does this, and I don't know coding enough to do one from scratch. Can I use z index to layer fields on top of an image? What are my options? It seems simple enough, but I'm stuck.

Thanks

agr42 on "Removing sidebar on mobiles"

$
0
0

I want to remove the sidebars when my site is viewed on mobile devices.
I've tried editing the CSS by adding code like:

@media only screen and (max-width: 685px) {
#sidebar {
display: none;
}
}

But this hasn't worked. Does anyone have any ideas/advice?

Thanks in advance

siraj.webchoiceuk on "Issue the get_the_terms"

$
0
0

Hi guys,
I used get_the_terms function to get terms of a custom post type and the response was an array of objects with term_id as keys for eg :

Previous

Array ( [57] => stdClass Object ( [term_id] => 57 [name] => Premium [slug] => premium [term_group] => 0 [term_taxonomy_id] => 61 [taxonomy] => support-type [description] => [parent] => 0 [count] => 1 ) [56] => stdClass Object ( [term_id] => 56 [name] => Standard [slug] => standard [term_group] => 0 [term_taxonomy_id] => 60 [taxonomy] => support-type [description] => [parent] => 0 [count] => 8 ) )

But this response has changed now and the key is starting from 0.

Now

Array ( [0] => stdClass Object ( [term_id] => 57 [name] => Premium [slug] => premium [term_group] => 0 [term_taxonomy_id] => 61 [taxonomy] => support-type [description] => [parent] => 0 [count] => 1 ) [1] => stdClass Object ( [term_id] => 56 [name] => Standard [slug] => standard [term_group] => 0 [term_taxonomy_id] => 60 [taxonomy] => support-type [description] => [parent] => 0 [count] => 8 ) )

A function was written based on keys (which was term_id at first) at development stage, but since the behavior of get_the_terms has changed now, my custom function results in an error.

Can anyone help why response of get_the_terms has changed ?

viktor89 on "Public Demo Admin"

$
0
0

hey everyone

So, I want to make a public demo install for possible clients to log in to and mess around with. Are there any good plugins for this? I was thinking something that resets it every hour or so, so people can change/add content and see how it works, but if somebody messes around with the install it'll be reset.

Also, for security reasons, I guess I should have some customized permissions. Just wanted to ask in here first and see if there were any good reads I should look into first?

thanks in advance


jimclay75051 on "Guest Map and Comment Fields"

$
0
0

Hello, I’ve spent the past several months try to create the look for my personal blog. There are two things I’d like for my blog which I am unable to do myself, or I do not know how to do. First, I would like a Guest Map and second I would like a comment field for “City, State, Country.”

1. Guest Map – Finding a nice guest map that I can afford has proved to be challenging. There are guest maps out there, but they either will not embed into my blog page or they seem spammy looking. I found one Guest Map at WP Google Maps that seems very nice, but it is way too expensive, this is just a personal blog after all.
So here is my question: Are there any WordPress map plugins that have the ability to allow visitors to pin or tag it. I know there are a lot of map plugins out there but I’m not sure if any of them can do that.

2. The second thing I need help with is creating a comment field for “City, State, Country.” I found a plugin called WP Comment Field Manager that is a good work around, but it seems like it should be possible to repurpose the email field (which I believe to be unnecessary) and use it to hold the “City, State, Country” info. I’ve figured out how to change the label for the email field and how to display it, but I have one remaining problem. The comment email field requires an email structure to the info that is enter into it. I need to change the field to a simple text field. Is there any way to change that?

Thanks

edowney on "Newbie question about java scripts in plugins"

$
0
0

So I just started learning to develop wordpress plugins (I have over 10 years experience with ASP.Net & c# and am a user of wordpress) this week and have made some decent progress. I'm to the point where I need to start creating some admin pages (which I figured out how to do).

The problem I seem to be running into is that I have a datetimepicker component I purchased as a suite of javascript controls. The demo works fine on my desktop but when I try to implement it in wordpress (which is also installed locally) the javascript doesn't want to run for the picker. To make sure I was actually loading the js file I put an alert at the start of the file and it got picked up when I refreshed the wordpress admin page. I used wp_enqueue_script on the admin_enqueue_scripts action. Any suggestions or tutorials would be greatly appreciated - thanx!

icetek on "How do I put PHP in a menu item as a link, for example: http://mysite.com/? (1 p"

$
0
0

How do I put PHP in a menu item as a link, for example: http://mysite.com/?<?php if (...) {...}else{...} echo ?>/ ?

Also, is it my username? Why doesn't anyone ever respond to my posts?

abearc on "tiny php help"

$
0
0

Hi,

I have a very simple php question, though it is not just wordpress specific.

Can anyone tell me why this string is returning the post number instead of the title?

$eventpl = str_replace($srcharr,$replarr,htmlentities(get_post_meta($ID,'a_businesses',true)));

If you want to see what the problem is, you can look at http://sandbox.mytripwas.org/

click on any icon on the map and you will see there is post number that appears on the map description bubble. That number is the post number instead of the post title that I want to display.

Any help is greatly appreciated.

common on "Using dashboard theme in frontend"

$
0
0

Hello!

Is it possible to use WordPress dashboard theme in frontend? I suspect that will have to edit a number of constants, but no direction in which to dig - I do not understand. Another option - similar to the design of the console topic, but these are not met, I would appreciate if someone tell me.

What is it? Working on a corporate resource, some of the functions that are available to the average user, and the extended version - for registered members of the organization, with tight integration with the dashboard. Itself had the idea to use the same design for the frontend and dashboard - this is understandable to the user and economical in terms of resources.

stevefigueras on "Upload image manually and veiwable by Wordpress"

$
0
0

Hello i need to upload image file and make it "viewable by wordpress interface".

So i upload file in 2014/10 folder by example.
I change CHMOD and USER like the other image in folder.

I add WP_post line fro this image

and in wp_postmeta i add _wp_attached_file & _wp_attachment_metadata.

But the problem is my image is shown in interface but not work (i got a blank thunbail and the the thunbail 120x120 90x90 300x300 ect are not generated.

Do i have forget something ?

Thank you

edowney on "Can't get $_POST data"

$
0
0

So I'm trying to create my first admin form for a calendar/scheduling plugin I want to make. The form looks good, the javascript issues are behind me and now I can't seem to get the $_POST data which is driving me crazy. I have tried a bunch of different ways (as you can probably tell by all of the commented out code) to no avail. In my current attempt I'm reposting to the page and testing for the submit button being clicked which does seem to pass through in the $_POST...just not the eventTitle.

I've been all over the interwb looking at examples but none of them seem to work for me so I'm obviously missing some crucial piece of information. Any help would be greatly appreciated!

<?php
/**
 * Created by PhpStorm.
 * User: eric.downey
 * Date: 10/31/2014
 * Time: 1:42 PM
 */

function sdCalendarAdmintInit()
{
//    add_action ( 'admin_action_SaveEvent', 'processSaveEvent' );
}

function processSaveEvent()
{
    global $wpdb;

    // Make sure this person can actually save this info...
    if ( !current_user_can( 'manage_options' ) ) wp_die ('Not allowed');

    $title = $_POST['eventTitle'];

    $tableName = $wpdb->prefix . sdEventTable;

    $wpdb->insert(
        $tableName,
        array(
            'title' => $title,
            'startTime' => current_time ('mysql'),
            'endTime' => current_time ('mysql'),
            'created' => current_time ('mysql'),
        ));

    // Redirect to the configuration form that was processed.
    wp_redirect( $_SERVER['HTTP_REFERER'] );
    //wp_redirect ( add_query_arg( 'page', 'sdCalendar_menu_settings', admin_url('CalendarSaveEvent.php') ) );
    exit();
}

function SDCalendarConfig()
{
    if( isset($_POST['Submit']) && $_POST['Submit'] == 'Save Event' ) {
        global $wpdb;

        print_r($_POST);
        echo "<br />";
        print_r($_GET);
        $eventTitle = (isset($_POST["eventTitle"]) ? "It's set" : "It's not set");

        $tableName = $wpdb->prefix . sdEventTable;

        $wpdb->insert(
            $tableName,
            array(
                'title' => $eventTitle,
                'startTime' => current_time ('mysql'),
                'endTime' => current_time ('mysql'),
                'created' => current_time ('mysql'),
            ));
    }

    $options = get_option( 'sdCalendar_options' );

    ?>
    <div class="wrap">
        <h2>Smith & Dow Calendar v<?php echo $options[ 'version' ] ?> Configuration</h2>
        <h3>Add/Edit an Event</h3>
        <form method="post" action='<?php esc_url( $_SERVER['REQUEST_URI'] ) ?>'> <!--<?php echo admin_url( 'admin.php' ); ?>"-->
            <input type="hidden" name="action" value="SaveEvent" />
            <table id="addEditEventTable">
                <tr>
                    <td>
                        <label for="eventTitle" class="required">Title</label>
                    </td>
                    <td>
                        <input type="text" id="eventTitle" > <!--class="k-textbox" placeholder="Event title" required validationMessage="Please enter an event title" -->
                    </td>
                </tr>
                <tr>
                    <td>
                       <label for="startDateTimePicker">Start date/time</label>
                    </td>
                    <td>
                        <input id="startDateTimePicker" >
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="endDateTimePicker">End date/time</label>
                    </td>
                    <td>
                        <input id="endDateTimePicker" >
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="allday">All day?</label>
                    </td>
                    <td>
                        <input type="checkbox" id="allDay" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="holiday">Holiday?</label>
                    </td>
                    <td>
                        <input type="checkbox" id="holiday" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="cancelOnHoliday">Cancel on holidays?</label>
                    </td>
                    <td>
                        <input type="checkbox" id="cancelOnHoliday" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="location">Location</label>
                    </td>
                    <td>
                        <input type="text" id="location" >
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="category">Category</label>
                    </td>
                    <td>
                        <select id="category" placeholder="Select category...">
                            <option>Open gaming</option>
                            <option>Tournament</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <label for="description">Description</label>
                    </td>
                    <td>
                        <textarea id="description" rows="5" cols="15" style="width:475px;height:220px">
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td valign="top"><label>Recurrence</label></td>
                    <td>
                        <div id="forecast">
                            <div id="tabstrip">
                                <ul>
                                    <li class="k-state-active">
                                        None
                                    </li>
                                    <li>
                                        Daily
                                    </li>
                                    <li>
                                        Weekly
                                    </li>
                                    <li>
                                        Monthly
                                    </li>
                                    <li>
                                        Yearly
                                    </li>
                                </ul>
                                <div>
                                    <div class="recurrence" id="noOccurrence">
                                        <div style="margin: 10px auto 10px; width: 440px;">
                                            This event only occurs once.
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="recurrence" id="dailyOccurrence">
                                        <div style="width: 440px;">
                                        <table>
                                            <tr>
                                                <td>
                                                    <input type="radio" name="dailyType" value="everyXDays">Every <input id="dayNumberDaily" type="number" value="1" min="1" max="364" style="width: 70px;" /> day(s)
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="radio" name="dailyType" value="everyDay">Every day
                                                </td>
                                            </tr>
                                        </table>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="recurrence" id="weeklyOccurrence">
                                        <div style="width: 440px;">
                                        Recur every <input id="weekNumberWeekly" type="number" value="1" min="1" max="364" style="width: 70px;" /> week(s) on:<br />
                                        <table>
                                            <tr>
                                                <td><input type="checkbox" id="sunday" /> Sunday</td>
                                                <td><input type="checkbox" id="monday" /> Monday</td>
                                                <td><input type="checkbox" id="tuesday" /> Tuesday</td>
                                                <td><input type="checkbox" id="wednesday" /> Wednesday</td>
                                            </tr>
                                            <tr>
                                                <td><input type="checkbox" id="thursday" /> Thursday</td>
                                                <td><input type="checkbox" id="friday" /> Friday</td>
                                                <td><input type="checkbox" id="saturday" /> Saturday</td>
                                            </tr>
                                        </table>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="recurrence" id="monthlyOccurrence">
                                        <div style="width: 440px;">
                                        <table>
                                            <tr>
                                                <td>
                                                    <input type="radio" name="monthlyType" value="dayNumber"> Day
                                                    <input id="dayNumberMonthly" type="number" value="1" min="1" max="31" style="width: 60px;" />
                                                    of every
                                                    <input id="monthNumberMonthly" type="number" value="1" min="1" max="12" style="width: 60px;" />
                                                    month(s)
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="radio" name="monthlyType" value="weekNumber">The
                                                    <select id="weekNumber" >
                                                        <option>first</option>
                                                        <option>second</option>
                                                        <option>third</option>
                                                        <option>fourth</option>
                                                    </select>
                                                    <select id="dayName" >
                                                        <option>Sunday</option>
                                                        <option>Monday</option>
                                                        <option>Tuesday</option>
                                                        <option>Wednesday</option>
                                                        <option>Thursday</option>
                                                        <option>Friday</option>
                                                        <option>Saturday</option>
                                                    </select>
                                                    of every
                                                    <input id="monthNumber2Monthly" type="number" value="1" min="1" max="12" style="width: 60px;" />
                                                    month(s)
                                                </td>
                                            </tr>
                                        </table>
                                        </div>
                                    </div>
                                </div>
                                <div>
                                    <div class="recurrence" id="yearlyOccurrence">
                                        <div style="width: 440px;">
                                        <table
                                            <tr>
                                                <td>
                                                    Recur every <input id="yearNumberYearly" type="number" value="1" min="1" max="99" style="width: 60px;" /> year(s)
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="radio" name="yearlyType" value="specifyMonthDay">On:
                                                    <select id="monthNameYearly" >
                                                        <option>January</option>
                                                        <option>February</option>
                                                        <option>March</option>
                                                        <option>April</option>
                                                        <option>May</option>
                                                        <option>June</option>
                                                        <option>July</option>
                                                        <option>August</option>
                                                        <option>September</option>
                                                        <option>October</option>
                                                        <option>November</option>
                                                        <option>December</option>
                                                    </select>
                                                    <input id="dayNumberYearly" type="number" value="1" min="1" max="31" style="width: 60px;" />

                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <input type="radio" name="yearlyType" value="specifyWeekMonth">On the:
                                                    <select id="weekNumberYearly" >
                                                        <option>first</option>
                                                        <option>second</option>
                                                        <option>third</option>
                                                        <option>fourth</option>
                                                    </select>
                                                    <select id="dayNameYearly" >
                                                        <option>Sunday</option>
                                                        <option>Monday</option>
                                                        <option>Tuesday</option>
                                                        <option>Wednesday</option>
                                                        <option>Thursday</option>
                                                        <option>Friday</option>
                                                        <option>Saturday</option>
                                                    </select>
                                                    of
                                                    <select id="monthNameYearly" >
                                                        <option>January</option>
                                                        <option>February</option>
                                                        <option>March</option>
                                                        <option>April</option>
                                                        <option>May</option>
                                                        <option>June</option>
                                                        <option>July</option>
                                                        <option>August</option>
                                                        <option>September</option>
                                                        <option>October</option>
                                                        <option>November</option>
                                                        <option>December</option>
                                                    </select>
                                                </td>
                                            </tr>
                                        </table>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input class="k-button" type="submit" name="Submit" value="Save Event" />
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <style scoped>
        #addEditEventTable td { padding: 10px; }

         .k-textbox {
             width: 11.8em;
         }

        label {
            display: inline-block;
            width: 100px;
            text-align: right;
        }

        .required {
            font-weight: bold;
        }

        .accept, .status {
            padding-left: 90px;
        }

        .valid {
            color: green;
        }

        .invalid {
            color: red;
        }

        span.k-tooltip {
            margin-left: 6px;
        }
    </style>
    <script>
        //$(document).ready(function () {
        jQuery(document).ready(function ($) {
            // Daily tab
            $("#dayNumberDaily").kendoNumericTextBox({ format: "0"});

            // Weekly tab
            $("#weekNumberWeekly").kendoNumericTextBox({ format: "0"});

            // Monthly tab
            $("#dayNumberMonthy").kendoNumericTextBox({ format: "0"});
            $("#monthNumberMonthy").kendoNumericTextBox({ format: "0"});
            $("#monthNumber2Monthy").kendoNumericTextBox({ format: "0"});

            // Yearly tab
            $("#yearNumberYearly").kendoNumericTextBox({ format: "0"});

            // create DateTimePicker from input HTML element
            $("#startDateTimePicker").kendoDateTimePicker({
                value:new Date()
            });
            $("#endDateTimePicker").kendoDateTimePicker({
                value:new Date()
            });
            $("#description").kendoEditor();
            $("#category").kendoComboBox();
            $("#tabstrip").kendoTabStrip({
                animation:  {
                    open: {
                        effects: "fadeIn"
                    }
                }
            });
/*            var validator = $("#title").kendoValidator().data("kendoValidator"),
                status = $(".status");

            $("button").click(function() {
                if (validator.validate()) {
                    status.text("Event title accepted.")
                        .removeClass("invalid")
                        .addClass("valid");
                } else {
                    status.text("An event title is required.")
                        .removeClass("valid")
                        .addClass("invalid");
                }
            });*/
        });
    </script>

<?php
}

msindependentnot on "Error Ecommerce site"

$
0
0

Hello,

i have an ecommerce site Riskspirit.com and my website isn't working and I get this error message:

It looks like this was the result of either:

a mistyped address
an out-of-date link
Perhaps searching can help.

Also, all my pages, products, orders, categories are deleted. I am freaking out and scared. Please help me.

fschirinzi on "Change widgets.php"

$
0
0

Hello community

I have a problem.
I want to customize the widgets.php page.

Idea:
Each user has to have an own Dashboard with own widgets.

First try:
Copy the widgets.php file into my theme direcotry, add a new menu item that render the php file and change all links into the widgets.php so that it should work... with no success. Isn't it possible or did I something wrong?

Second try:
Add a hook, so that 'Inactive Sidebar (not used)' and 'Inactive Widgets' will be not shown in the edit widget area. But I can't find the appropriate hook/filter/action

Thank you,
Francesco Schirinzi

iamwordimpressed on "Hook for getting complete Http-Response (Content) of WP Page?"

$
0
0

Hello Experts,

I want/need to implement my own caching. Is there a hook (either in WP) or PHP (I am newbie), that allows me to get the full response that WP generated so I can put that into a cache?

How do the Caching Plugins Work? Do they all issue a internal http request (with the WP http Class) and then cache this? Ideally I want to not issue any unnecessary additional request but rather "capture" a request by a real user and use that as my caching data.

Thanks!

charlenedavis on "500 error"

$
0
0

My website keeps giving out 500 internal errors, any ideas why this could be?

URL is here

Thanks :-)

briancostea on "$wpdb->get_results returns empty array if called more than once"

$
0
0

If I call $wpdb->get_results() twice in a row it returns an empty array the second time. I know the SQL is good b/c it is successful.

$totalsdata = $wpdb->get_results( $wpdb->prepare( "call dl_db_totals('%s', '%s', %d);", $startdate, $enddate, $current_user->ID ) );
print_r($totalsdata);
$totalsdata = $wpdb->get_results( $wpdb->prepare( "call dl_db_totals('%s', '%s', %d);", $startdate, $enddate, $current_user->ID ) );
print_r($totalsdata);

The first result prints a full array of values, the second prints an empty array (i.e. Array ()).

The context for this when a you need to call $wpdb->get_results() in a shortcode and the author includes more than one shortcode in a post.

Viewing all 8245 articles
Browse latest View live




Latest Images