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

rahendz on "could fontend form send post data into database"

$
0
0

i'm indonesia and not well in english. i've many times googling and didn't found any ways. i've develop a plugin, simple plugin, to let people add their data without registering.

for example, i'm selling a tshirt. and i make it pre-order list. so people that want to buy they only need put their name and contact into my site, which will submit into my wp database without register or login.

and what i'm asking, is there any way to let form in frontend to send data and insert into database without login or register as a user? thanks and sorry for my bad english.


rahendz on "generate sql.zip from db when deactivating"

$
0
0

hi again. i'm indonesia and not well in english. i've many times googling and didn't found any ways. i've develop a plugin, simple plugin, same as before but different problem.

i've put a code to create table when plugin install and drop it when uninstall, and the question is there any ways to create or generate plugin table into sql.zip before it dropped and available for download?

thanks and again, sorry for my bad english.

hovida on "wp-cron.php - wp_mail not working"

$
0
0

Hey guys,

i wrote a simple Plugin for sending mails over the cronjob.
WP_CRON is disabled and outsourced to crontabs on the server, for example:

* * * * * /usr/bin/php5 -f /homepages/23/d471228603/htdocs/wp-cron.php >> /homepages/23/d471228603/htdocs/cron.log

Here is the source: http://pastebin.com/tA4JgEBC

Description:
For testing, i use the direct-link to wp-cron on my Browser (for example: http://domain.com/wp-cron.php)

When i use the wp_mail function first time, i become an PHP Error:

Fatal error: Cannot redeclare class phpmailerException in /homepages/23/d471228603/htdocs/wp-includes/class-phpmailer.php on line 2825

After reloading the page will be blank/white. The printing of display_name and email of the users will be not printed.

Can anyone tell me why this does not work?

I would like to use WordPress-own functions and needs wp_mail here.

Jhihaat on "theme options"

$
0
0

hi ,
I want a tutorial for create a theme options just for managing theme images , an upload form for each image and the save options button , nothing else ...

tnx

target4515 on "Customizing topics and comments"

$
0
0

Okay, I am new to Wordpress and it is EXACTLY what I have been looking for. However, I have been beating my head in trying to make this work. I have very limited knowledge of code, etc… but here goes. My clients send my company ‘orders’ (which are service requests). I want my clients to be able to login and view only their orders (which will be the topics) and chat back and forth with me as to the progress of the job (which will be comments). Each client, say 5-10 different clients, will have their own ‘filters’ to show only the ‘orders’ for their company. I also want to add fixed width columns to the title of the original posts. So say the header or topic of the original post should have the data =
(Order number)_____(Customer Name)____(order entry date)___(Order Type)____(Order Status)_____(Client name).

And in the post list view this information would look very clean like it is in a form. When they select one of the orders from the list, it then goes into the comments for that order (or topic). I am struggling getting ANY of this to work! I really need help with this one – I have been working on this for many hours/days and just cannot seem to get it together. I like to try to do thing myself but this is just over my head, I guess… So I humbly turn to your expertise. Thanks for any help you can provide.

Gajendra on "How to create category post list like below site"

$
0
0

anybody help me thankful
Iam Trying create category post list like below site
http://www.freejobalert.com/
am trying no use tell me which plugin for that and where to change

thank you

skhan86 on "PluginBear LikeLock Does Disappear the fade screen even after the page is liked"

$
0
0

I recently installed a plugin called PluginBear LikeLock for my website and its results are awesome. However, it asks for facebook App ID in order to remember which users have already liked the page so that they should not be shown the locked page when they again come to my website.. I have searched everywhere how to create such app but all in sane..

I dont have any idea about programming, and at the same time, I dont have the budget to ask someone to make it for me....Yet, I am capable enough to make an app if provided with a Demo or step-by-step guide, as I did to integrate facebook pluggin and app on my site.

PLease help how can I make an app for the particular pluggin installed.

navyspitfire on "Target only pages in the same category"

$
0
0

I've been scrapping together pieces of code, but with this code I am trying to have it so it only targets pages in the same category. Ideas?

<div class="port-nav left">
        <?php
            /**
             *  Infinite next and previous post looping in WordPress
             */
            if( get_adjacent_post(false, '', true) ) {
        ?>
                <p class="prev"><?php previous_post_link('%link'); ?></p>
        <?php
            } else {
                $first = new WP_Query('posts_per_page=1&order=DESC'); $first->the_post();
                    echo '<a href="' . get_permalink() . '">&larr; Previous Post</a>';
                wp_reset_query();
            };
        ?>
        <?php
            if( get_adjacent_post(false, '', false) ) {
        ?>
                <p class="next"><?php next_post_link('%link'); ?>
        <?php
            } else {
                $last = new WP_Query('posts_per_page=1&order=ASC'); $last->the_post();
                    echo '<a href="' . get_permalink() . '">Next Post &rarr;</a>';
                wp_reset_query();
            };
        ?>
    </div>

Theopt on "Get user tipe"

$
0
0

I've searched FAQ but I couldnt find how to get user tipe (administrator, editor etc), can only get name/email etc

A31 on "Insert PDF File to Custom Database Table"

$
0
0

Hi all,

Can anyone please advise me how I can insert a PDF file that a user selects from a html form into a custom table in the database?

My code so far is:
$OrderNumber= $_POST['txt_OrderNumber'];
$UploadAttachment = $_POST['txt_Attachment'];

$wpdb->insert('wp_Attachments',
array(
'OrderNumber' => $NextOrderNumber,
'FileContent' => $UploadAttachment
),
array(
'%s',
'%s'
)
);

Although I do not get any errors, the size returned in the database is 0.

Any advice please?

alanchrishughes on "Does Wordpress Block HTML 5 Video?"

$
0
0

I've been trying to make this extremely basic page template for videos

<?php get_header(); ?>

<video width="1280" height="720" controls>

<source src="<?php echo get_post_meta($post->ID, 'webm', true); ?>" type="video/webm">

<source src="<?php echo get_post_meta($post->ID, 'mp4', true); ?>" type="video/mp4">

</video> 

<?php get_footer(); ?>

But it wasn't working. I thought maybe it was a problem in the way I was calling for the custom field entry for the videos urls, but even when you directly code the url's, you get an error saying "No video with supported MIME type found."

The code works fine a basic html page, so I assume it must be a problem with Wordpress? Anybody know how to fix it?

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

obsessedwithfilm on ""Fake" pages for categorties?"

$
0
0

Is there a method to create fake pages for categories?

Let's say I currently have the following top level categories:

- Film
- Gaming
- Music

What I want is to be able to have the following as active pages on the site:

xxx.com/film/news
xxx.com/film/features
xxx.com/music/news
xxx.com/music/features
etc

Essentially creating custom archive pages for specific type of content within each category. I just don't know how to go about creating these "phantom" sub categories in order to be able to have the custom templates for those URLs.

martin_666 on "WP_Query - multiple custom post types and sort by custom meta"

$
0
0

Hello guys,

I'd like get results from two custom post types and sort them by custom meta (date of start events).

This code:

$warsztaty_q = new WP_Query(array(
	'post_type' => array('kalendarium', 'warsztaty'),
	'order_by' => 'meta_value',
	'meta_key' => 'data_start',
	'order' => 'ASC'
));

Would be ok but first sorted is 'kalendarium' and then 'warsztaty' so in query results first sorted are posts from 'kalendarium' and next from 'warsztaty' not together.

I found this solution:
http://wordpress.stackexchange.com/questions/71576/combining-queries-with-different-arguments-per-post-type

But I can't get custom meta :(

Anyone can help me? :)

Howdy_McGee on "Add Custom Field to Categories in Custom Post Types"

$
0
0

I'm able to add a field to the Categories, but only under Posts - as in it's not showing up under my CPT categories, I want them to Only show up under my CPT Categories. Do I need a different hook?

Here's what I have so far:

/** Add New Field To Category **/
function extra_category_fields( $tag ) {
    $t_id = $tag->term_id;
    $cat_meta = get_option( "category_$t_id");
?>
<tr class="form-field">
<th scope="row" valign="top"><label for="cat_Image_url"><?php _e('Category Image Url'); ?></label></th>
<td>
<input type="text" name="Cat_meta[bgc]" id="colorinput" size="3" style="width:20%;" value="<?php echo $cat_meta['bgc'] ? $cat_meta['bgc'] : '#fff'; ?>" class="my-color-field" />
<div id="colorpicker"></div><br />
            <span class="description"><?php _e(''); ?></span>
				<br />
        </td>
</tr>
<?php
}
add_action ( 'category_add_form_fields', 'extra_category_fields');

/** Save Category Meta **/
function save_extra_category_fileds( $term_id ) {
    if ( isset( $_POST['Cat_meta'] ) ) {
        $t_id = $term_id;
        $cat_meta = get_option( "category_$t_id");
        $cat_keys = array_keys($_POST['Cat_meta']);
            foreach ($cat_keys as $key){
            if (isset($_POST['Cat_meta'][$key])){
                $cat_meta[$key] = $_POST['Cat_meta'][$key];
            }
        }
        //save the option array
        update_option( "category_$t_id", $cat_meta );
    }
}
add_action ( 'edited_category', 'save_extra_category_fileds');

jmwinfree on "Add Search Box to Custom Menu"

$
0
0

Hi everyone! Been searching through the posts, and haven't found any info on it, but maybe it's a really simple fix and I'm just missing something.

I created a custom header menu so I could exclude certain pages. What I want now is a search box on the right side of that menu. Is that possible, and how do I do it?

Here's the website:
http://www.blue-water-transport.com
Using Responsive full width featured area Child Theme.

Thanks so much!

Help Me on "Amazon Affiliates Links using Function.php to generate link also using ACF field"

$
0
0

Hi there,

Basically I am trying to get a function to work in a page theme file so that I can set a link on an image and some text to the products amazon page. I have create Books as a custom post type, and have developed a number of customer fields using Advanced Custom Fields.

One of these fields is n Amazon Affiliate Product Number.

This number is to be used as part of the link.

Currently my function in function.php looks like this:

function getAffiliateLink($productCode)

{

  global $VisitorCountry;

  if ( isset($VisitorCountry) ) {

    if ($VisitorCountry->GetCode() == 'GB') {

      return 'http://amazon.co.uk/gp/product/' . $productCode . '/?tag=indautlan-21';

    } else if ($VisitorCountry->GetCode() == 'CA') {

      return 'http://amazon.ca/gp/product/' . $productCode . '/?tag=indautlan00-20';

    } else {

      return 'http://amazon.com/gp/product/' . $productCode . '/?tag=indautlan-20';

    }

  }

}

One of my anchor tags currently looks like this:

<a href="<?php ?>" title="Get more details for <?php the_title(); ?>">
						<div id="book-cover" class="featured" style="background-image:url('<?php echo $image[0]; ?>')">
						</div>
					</a>

This is missing the href obviously as I am still trying to work out how to call the function, as well as place the Amazon Product Number in the $productCode variable in the function.

Also, I call the Amazon Product Number from Advanced Custom Fields using:

$asin = get_field(amazon_product_code);

Any help anyone could give me on this would be highly welscomed... I also have another post open on another issue but regarding the same site, that can be found here:

Hope to hear back from someone soon, any help on this would be very very appreciated, sure I'm just missing something simple!

shanebp on "cpt & categories"

$
0
0

I have a cpt with front-end creation on the front page.
Using a 2013 child theme.

Using wp_dropdown_categories to output the cats and the output is correct:

<select name="cat" id="cat" class="postform">
	<option value="-1">Select Category</option>
	<option class="level-0" value="1">Uncategorized</option>
	<option class="level-0" value="4">National</option>
 etc.

After inserting the post, I do this:

$selected_cat = array( $_POST['cat'] );
wp_set_post_terms($post_id, $selected_cat, 'category');

Everything works except when I submit I end up on the 'Nothing Found' page.

But the cpt is created and assigned to the selected category.

But when I go to a listing of all the created cpts, and click the assigned cat, I again end up on the 'Nothing Found' page.

Looking in the _term_relationships table, I see that the cpt ID and term_taxonomy_id are correct.

In wp_admin, in the cpt tab, the cpts are listed with the correct cat
and clicking one shows only those cpts in the same cat.

If I go to Posts > Categories, it shows zero posts in all categories.

If I remove the cat selector from the creation form, and do a submit, it refreshes to the page and gives me the success message.

In register_post_type, I have:

...
		'taxonomies' => array('category'),
		)
	);
	register_taxonomy_for_object_type('category', 'mycpt');

So I'm doing something wrong re the cat selector... or... ?

aeroxtechnology@gmail.com on "Unable to create table during plugin installation"

$
0
0

Hi,

I am new in wordpress plugin development.i have created a wordpress plugins but when i installed the plugin it's not created a database table.

Please suggest me.

Thanks in advance.

Tyler on "Image appear on hover"

$
0
0

Hi
I want to build an image hover feature into my site, I have a list of text links and I would like an image to appear in a fixed position on the page. Each link will show a different image in the same place on the page.

Any pointers on how to do this or to plugins/tutorials would be very welcome.

Viewing all 8245 articles
Browse latest View live




Latest Images