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

sajtdavid on "Cron problem"

$
0
0

Hi!

I'm trying to schedule events but it acts very weird.

Schedule command:
wp_schedule_single_event( strtotime($_REQUEST['newtime']) - 3600 + 10, 'event_for_new_home_post_trigger' );

I ran it multiple times, and sometimes it worked sometimes it is not.
Downloaded this plugin:
https://wordpress.org/plugins/cron-view/

and saw only 2 entries, while there should be more than 5.

dumped the output of the function and I got false, however there was no new entry at the cron view plugin. Checked the core cron.php, and found this line:

$next = wp_next_scheduled($hook, $args);
	if ( $next && $next <= $timestamp + 10 * MINUTE_IN_SECONDS ) {return}

So if there is a same event close to the new, it returns null.
The docs can be confusing here, since it says:

(boolean|null)
False if the event was cancelled by a plugin, null otherwise.

I wanted to find out which event is next to my event, so I ran wp_get_schedule, and it returned nothing.
I used the wp_next_scheduled command too, and it returned the next event:

var_dump(wp_next_scheduled('event_for_new_home_post_trigger'));
	var_dump(wp_get_schedule( 'event_for_new_home_post_trigger' ));

=>

int(1415340010) bool(false)

So I got no schedule, but I got the next schedule.. how is this possible?

Thanks for any kind of help.


khan143 on "How to create a custom table in wp, and how to enter the data in that table"

$
0
0

Hi guys.
I am completely new to wordpress. and using it in my first project as a starter.
I have custom html,css template which I have converted to wordpress.
In this template there is a form for front end users which has fields like "Date & Time from", "Date & time to" which is a date & time picker, "Name", "Email", a dropdown list, and "Message" which is a text area and an optional external file attachment option.
Now I want to customise it in wordpress, that when a front end user fills this form then its data should be saved in a custom table in database, and the admin can see, update and delete this data on admin side.
Please if anyone one knows the answer or having plugin then please tell me.
thanks in advance.

miss-thong on "adding a file upload from dashboard?"

$
0
0

I was really hoping/wanting to have a file upload within the dashboard, i thought a good option was to use the simple dropbox upload plugin. Which seemed to be great if you want to have the coding on a web page or something but i wanted it as a widget on the dashboard where i've already got my custom html widget for the dashboard.

What would be the best way to implement this? Is it at all possible.
Main problem i see being that the plugin uses a wordpress command
[simple-wp-dropbox]

So as this way looks to fail, what other ideas do people have?
Could i create my own php, html?

Thank-you for any help, all help is appreciated.

Astittle on "Static Page Elements"

$
0
0

So I was looking at some of the features WordPress sites and came across this Google Ventures one:
http://www.gv.com/

What I found particularly cool about it is if you click any of the links on the left (team, for example) you are directed to their /team page. However, the menu bar on the left hangs around and becomes this kind of expandable thing. You can mouse over it and it moves in and out. Clicking on another link then keeps the navigation bars smooth movements going while the next page loads. It's as if the navigation bar never needs to reload and is just there all the time, independent of the links that are loading.

I was wondering, how might they have accomplished this? Everything I've always done had the whole page reload when a link was clicked (except AJAX stuff, but then the URL didn't change).

Any insights welcome!

klevi_surf on "Add attachment into WordPress Programatically"

$
0
0

I am wokring in a sound project adding mp3 files from frontend, the mp3 files get uploaded via zip format and after that WordPress handle this by unziping the mp3 files, after this need to be added into WordPress media, but without success. The files added are not fully correct and without name, any idea or help about this?

http://laravel.io/bin/nQl3k

simplicity7 on "How Category works"

$
0
0

I'm just having a bit of a hack. I've dumped out the "terms" table, it has three entries. However when I go to the Categories page under Posts there is only one Category. Why please?

Chris Huff on "Change text of plugin"

$
0
0

Usually when I want to edit a plugin, I just edit the plugin. But this means that I need to edit it every time the plugin is updated. I like receiving plugin updates, because they often bring bug fixes or new functionality, but I don't want to have to make the same edits to the same plugins over and over again. Is there a better way?

For example, in the Social Connect plugin, I want to change the words "Connect with" to "Login with"

Is the best way just to edit the plugin files, like I've done in the past, or something else?

rohan1819 on "Links not working correctly."

$
0
0

I am creating website for one of my client and when i give link to some text pointing to some different url its opening my site url and linked url also, suppose if link some word to http://www.google.com its not opening as http://www.google.com. its opening as "http://mysiteurl/\www.google.com" and showing 404 error


Majklas on "flexslider to load few images at once"

$
0
0

I was wondering if any (now I'm using flexslider) plugin or gallery script could do this for me: if picture is less than x px, then it would load another fitting picture in the same box.
So to say, I have 900px wide flexslider container, I'd like to show one picture 900 px wide, then other two by 450px. Could they be loaded into one "slide"?
Looking for any options..

Advantages :
no PhotoShop needed to combine those images into one;
use empty space on long narrow images;
get the most info for client;

Avi Tannenbaum on "Auto generate template sub-page with username as title"

$
0
0

Hi,
How do I automatically generate a sub page for every user that registers to my site?
I want the title of the automatically generated page to be equal to the username of the user and be placed with a certain page template.
Any help out there?

here is my website:
http://www.StarShowsStudios.com

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

pavzcap on "automatically duplicate post template changing certain key variables"

$
0
0

Hi All,

I am new to this forum and have just embarked on my wordpress journey.

I was wondering if I could get some help on something I am trying to achieve. I am basically making posts on the FTSE 100 companies, each basic post follows the same generate template for each company, namely:

[su_heading]CompanyName[/su_heading]

[su_button url="http://www.CompanyName.com" target="blank" background="#1f8e2a"]ZDG plc site[/su_button]

[google_news query='"CampanyName"' sort="n"]

Essentially a header for the company, a button linking to their website and a google feed showing the news for the company. Beyond this each post will be tailored.

I was wondering if there is any way that I can automatically generate 100 posts and change the variable 'CompanyName' with a given name from a list, possible via a loop function? I am very new to php and am thinking in terms of VBA which I am far more familiar with. Is anything like this possible? It would save a lot of tedious time rather than copy and pasting manually. Can I build a plugin to do this?

Any help on this issue would be much appreciated. Please ask me any questions if I have not been clear in what I am trying to achieve.

Thank you in advance

dannydanny on "Google Webmaster Errors -- Theme Twenty Twelve"

$
0
0

Part 1 (part 2 below)

I'm using the theme Twenty Twelve and I have searched high and low across the Internet for the solution to my problem. I'm getting this error in google webmaster tools:

Error: Missing required field "updated".
Error: Missing required hCard "author".

My site is a site with hundreds of static PAGES, not posts. I do have a blog that goes along with the site, but I don't even have those posts indexed. I only care about the pages.

I have implemented the "entry-date updated" fix I've seen all over the place in the functions.php file (line 375; latest version of Twenty Tweleve; version 1.4). I still am getting the errors for all my static pages.

I have the message that authorship is working for the page.

However, in the "extracted structured data" section, I get the above-mentioned errors for all my site's pages.

As I said, I have authorship working. My google+ account is successfully linked with my site.

So, is there any obvious, simple fix to this problem that I'm missing?

Any help would be appreciated. I know there are multiple posts about this on the Internet and on these forums, but I can't find the fix for my specific problem.

My site: http://truthsaves.org/

Part 2 (a few days later)
I'm still working on the problem. Any assistance would be greatly appreciated. I've solved half of it.

I found this line in the content-page.php file:

<h1 class="entry-title"><?php the_title(); ?></h1>

and I changed it to this:

<h1 class="entry-title updated"><?php the_title(); ?></h1>

I just added the word updated.

Now the updated error that I posted in my original post is gone. Remember this is for the theme "twenty twelve" pages, not posts.

I still have the following error and not even sure it can be fixed! I'm sure it can. But maybe twenty twelve doesn't have any support for author markup in pages. I don't know.

Error: Missing required hCard "author".

Any help? Would love it if someone could help.

ben83 on "How to get two thumbnails sizes in a custom loop ?"

$
0
0

Hi everybody,

I need help to set two differents thumbnails sizes; A big one for the last article, and then, normal ones.
Here is my custom loop, in order to identify the last post as "featured". Right now, there is just one thumbnail size both for "featured" and "regular".

<?php while (have_posts()) : the_post(); ?>
<?php if (is_paged()) : ?>
<?php $postclass = ('regular'); ?>
<?php else : ?>
<?php $postclass = ($post == $posts[0]) ? 'featured' : 'regular'; ?>
<?php endif; ?>
<div class="<?php echo $postclass; ?>">
<div class="thumbnail">
	<!-- post thumbnail -->
		<?php if ( has_post_thumbnail()) : // Check if thumbnail exists ?>
			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
				<?php the_post_thumbnail(array(583,420)); // Declare pixel size you need inside the array ?>
			</a>
		<?php endif; ?>
		<!-- /post thumbnail -->
</div>
<detail>
		<!-- post title -->
		<h2>
			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
		</h2>
		<!-- /post title -->
<!-- post details -->
		<span class="date"><?php the_time('F j, Y'); ?> <?php the_time('g:i a'); ?></span>
		<span class="author"><?php _e( 'Published by', 'html5blank' ); ?> <?php the_author_posts_link(); ?></span>
		<span class="comments"><?php if (comments_open( get_the_ID() ) ) comments_popup_link( __( 'Leave your thoughts', 'html5blank' ), __( '1 Comment', 'html5blank' ), __( '% Comments', 'html5blank' )); ?></span>
		<!-- /post details -->
		<?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?>
		<?php edit_post_link(); ?>
</detail>
	</div>
<?php comments_template() ?>
<?php endwhile ?>

I tried some stuffs but it doesn't work. I am a beginner in PHP ! :-/
If you could help... Thanks in advance.

Saad Rafique on "How to Add Page Navigation at the end of a Page"

$
0
0

I have created a page, and i want to add 10 posts from a specific category on this page. I have no issue in doing so. But now i want to add a wp pagenavi at the end of those 10 posts from a specific category. So reader can navigate to rest of the articles from that category on the same page. But i don't know how to do it, can someone help me in this regard. Thank You.

I want to do same thing as it is appearing on this page.
http://goo.gl/TfjjJA


razy.elad on "How to implement a Plugin with on-the-fly built table"

$
0
0

Hi,
I want to write a plugin which will provide the publisher an "on the fly" table where already existing records are uploaded from the db and displayed and could be updated. New records can be inserted and store.
The records will contain words from the posts so the table should be generic to all posts.
Please provide your feedback and example regarding the best way to implement such plugin.
BR, Elad

frha on "Showing private pages in default page-menu"

$
0
0

I was struggeling to be able to show private pages in the default page-menu when user was logged in.

Finally i was able to do this in a child-theme, but it should have been a standard way to do this regardless of the theme chosen...

I would suggest that the core-developer just adds a few lines in includes\post.php like this :

// Make sure we have a valid post status.
	if ( ! is_array( $post_status ) ) {
		$post_status = explode( ',', $post_status );
	}
  //Added to show private pages if user can view them
  if(current_user_can('read_private_pages')) {
    $post_status[] = 'private';
  }

But since it's a bad idea to change those in my own installation, I can add this through the filter-mechanism like this (in my child-theme's functions.php) :

function my_page_menu_args( $args ) {

  if(current_user_can('read_private_pages')) {
    $args['post_status'] = 'publish,private';
  }
	return $args;
}
add_filter( 'wp_page_menu_args', 'my_page_menu_args' );
}

Toomas91 on ".htaccess help?"

oudrib on "The custom widget display empty after drage and drop"

$
0
0

Hi,
i have create a custom widget and it's work correctly but when draging the widget inside the sidebar the widget display empty but after reloading the page the widget fill with fields can some one help me please Thanks :)

FliperSClub on "User registration and management, and one click job application"

$
0
0

Hey all

I am building a theme from "scratch" (using _s (underscores) by Automattic) to create a recruitment website.

For custom fields I feel comfortable using ACF Pro. For the job listings I am going to create custom-posts. However, I am struggling to find a plugin or hacks to:

- create the registration form (in the front-end - not the '/wp-login') with custom fields like CV and cover letter;
- create a database (that includes the CV and custom fields) from the registration form so that my client can have direct access to the table of applicants, their CVs and info;
- create one-click apply buttons so that (ONLY) when applicants are logged they can apply to jobs;
- and the administration gets notification of when the applicant "clicks on this button" - better even if this gets registered in the same database/table.

Most job board plugins have a craigslist/gumtree way of working, whilst I want a only the agency can post jobs and accept applicants.

I would prefer developer/web-designer-friendly plugins and hacks so that the code and theme is not wasteful!

Thanks in advance if anyone can help,
Filipe

Viewing all 8245 articles
Browse latest View live




Latest Images