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

SoftEngi on "Trying to make a plugin to detect what action takes time to load"

$
0
0

Hi everyone, thanks for taking the time to help me. Here is what I'm trying to do:

I was given the task of finding out why the wordpress of one of my friend was so slow, so I made a very simple plugin that hooks different actions and filters in order to see what takes time to load. Those are the actions/filters I hooked:

plugins_loaded, init, setup_theme, wp_loaded, wp_head, the_content, wp, wp_footer, shutdown.

And it works perfectly well, except there is a 5-6 seconds delay between wp_footer and shutdown, and I have no idea what could go in between that would slow it so much? Any actions I can hook in between those two?


camweb21 on "Categories, posts and breadcrumbs"

$
0
0

I'm currently creating a website for a wedding venue here http://www.cwsdev.co.uk/southfarm
When you click on one of the navigation items on the left hand side such as 'weddings' the sub nav is open on that page and remains open whilst you are in the sib pages of wedding. The breadcrumbs also work perfectly showing you that you are in the wedding area,

If you then click suppliers, towards the bottom of that page is a list of suppliers categories automatically generated from sub categories of the category supplier. The problem is if you click one of these it takes you to the archive.php page but this then closes the sub navigation for weddings and the breadcrumbs show blog instead of wedding.

How can I hack it so it believes it is still in the wedding area and shows the correct breadcrumb trail and the sub nav remains open?

Thank you for any help. Sorry if I waffled on too much.

Damyan90 on "Mail Notifications Only When Published From Certain Category"

$
0
0

Hi Everybody!

All day long I was looking for an app, which would send email notifications to my subscribers, only when a post through a one certain category is triggered.

So I found an application called Post Notifier For All. It is really simple and easy to use. I love it!

The problem is, it sends email notifications to my subscribers whenever I post anything, and not only when I use the specific category.

So I decided to go into the plugin's editor mode and I found this:

$post_categories = wp_get_post_categories( $post_ID , array('fields' => 'all'));
        $cats = '';
        foreach ($post_categories as $cat){
        	$cats .= $cat->name.', ';

It looks to me like it might happen!

If you think you can help me with this, the category I want to use is called Hot and its ID is 195

I would be grateful if you manage to help me with my problem!

Kind Regards,
Damyan

mosth on "spam in tagline"

$
0
0

The tagline in the header shows added text (spam),

tagline "a social club of retired and semi retired La Jolla professionals" - spam "Xanax no prescription"

How do I get rid of " Xanax no prescription"?

The spams shows in google app or browser or but not with safari browser

chase.clymer on "Embedding Tumblr Feed"

$
0
0

Clients website is a very limited subdomain of a larger corporation and due to security measures the only thing I have access to is editing the page.

Can not install additional plug ins. Though this widget is installed if it helps get us there:
https://wordpress.org/plugins/tumblr-widget-for-wordpress/
This embeds on sidebar, and they want it on the page feed.

Need to generate a tumblr feed on their /blog page

I'm not a complete moron when it comes to this stuff, but this is seeming to stump me since the limitations I'm facing. Anyone got an idea?

Trebly on "Need help in hacking for url rewrite and set new added query value for posts"

$
0
0

Hi,

I need some help to develop a hack :
I am new in WP development I begin to understand most of soft contents (plugin not yet published, hacks, themes...) but not sure at all in the following :

I have to do:

  1. Add endpoint using add_rewrite_endpoint seems easy
  2. Add query value add_rewrite_tag we can get the new query arg ['section']
  3. Before the analyse of query : read data (new column) for a post, determine and set the query value for the new query arg

The other plugin extensions are OK, I can normally develop or have developed without difficulties.

I am not sure of the sequence of actions (must be the first process : it builds the request for full compatibility giving section_name and old page number) and priorities.

Thanks
Best regards

Trebly
__________________________________________________________________________
note : I detail the development reasons and design in :

Trebly on "Stable links to fragments identifiers into paginated posts enhancement"

$
0
0

Hi,

It seems well that : when paginated posts are used the common fragment identifiers cannot be used easily (see detailed note), because the pages are identified by their number (page=<num_page>) which is not a stable data.
This makes quite impossible to develop and test internal links and maintain long paginated documents with many fragments identifiers because pagination can easily change.

After researches of existing solutions, I decide to develop "something" which is quite fully designed, the feasibility checked, too some main parts of code.

For now, because I am new in WordPress developments I need some help.
I don't think at all that the problem is only a pluging problem.
There are some things that I don't know how to do for hacks.
I do not know anymore where are good existing examples.

The development features are :
(to avoid errors we replace the "page" of paginated post by the "section" word : then a post can have sections)

- A section can be named by the use of a shortcode associated with <!--nextpage--> into the document.
- optional replacement of the url of section identified currently by his number : <permalink>/<num_page>/
by
A new syntax which is the unique way (in my opinion) to reach a fragment into a paginated post
<permalink>/section/<section_name>/

- determine and store the post datas which describes the post sections (needs a wp enhancement - add a column to post table, or badly a special table like for a plugin for storing the pagination data, updated when the post is saved) containing :
post, version : table (json) with for each section (section_name, title, page_num)

Then the steps of url treatment are :
- with a add_rewrite_endpoint it becomes
<permalink>/?section=section_name

- with add_rewrite_tag we can get the new query arg ['section']
- read first the sections data (pagination) from data base using the permalink

Then I need to set into the current query the hook (set by add_action) to set the query var "page=<num_page>", the only known identifier of the "section" known by other WP soft elements.
(I don't know how to do this : must be placed just at the query.php beginning ?)

I am not sure of the sequence of actions (must be the first process : it builds the request for full compatibility giving section_name and old page number) and priorities.

The other parts of the soft with which I have no problem at all are :
- treatment of the content to set the pagination (or sectionning) data (shortcodes)
- writing pagination data at saving posts.

To test, I developed a "at display" treatment which sets
the internal good urls (as shortcodes) into href to fragments. This makes the fragment url identifiers displayed usable (replacement into urls of the section_name by the page number at display).

But the external links cannot be obviously kept anywhere with reliability because links to fragments are broken by any pagination change while section_names are stable data.

I think that it is not a so important work.

I hope this is interesting development.

Best regards

Trebly

________________________________________________________________________
(note :For clarity the concept of an article page is replaced by article "section" (concept which covers easily : parts, main chapters, which uses are naturally extended to summary, bibliography, indexes etc.)

The styling pages link brakes the concept of spaces for html/xml.
A post is no more, with the pagebreak feature a space, it is the section which is, but it is managed as an entity by WP.

The enhancement restores a HTML/XML true space as a section for post paginated : divided into sections.

Then when you creates a document a fragment identifier "#<fragment_name>" cannot be used if a <!--nextpage--> (or equivalent) is used into the document. The URI is unknown. This is proper to the multipage concept not at all to any multipage plugin.

I have not found anywhere information (and I worked a lot on this subject) about the way to define a fragment reference inside a multi page document a tag href or to externally reference a fragment which is contained into a multipage document.
_______________________________________________________________________
remark : It is very difficult to write such projects without any preview of the content of message... sorry I can edit after for a while.

malkah on "Responsive theme- change the order of elements in a page"

$
0
0

Hello members of the forum

I have a WordPress site with a responsive theme.
here is an example of a relevant page:
http://www.kastach.co.il/lorem-ipsum-page

I use a widget of a small search form: widget_mfn_infopay

when I enter an inside page like the above example, from a cellular devise or a small resolution device the responsive theme fires but the CONTENT section is above the widget.
So a user needs to scroll all the way to the bottom of the page to reach the widget area.
how can I change the order of the page only for cellulars, so that the widget is **above** the content?

I will appreciate any help,
Thanks


joshjacobson on "How can I customize the views count for each post count?"

$
0
0

I am using the voice theme, and I'd like to customize the views count for each post.

sunflyer on "toplist plugin"

$
0
0

I'm making a toplist plugin for wordpress. Starting out easy with just basic stuff like a votelink with ID the users place on their websites to gather votes when visitors clicks it. I'm new to writing plugins for wordpress and I have limited experience with php too, but I will figure it out with some help :)

I just wanted to know how I should collect votes, like other toplists I've tried there is like a counter script in a file that would be something like counter.php?siteid=X

How would that work for a plugin since all files for the plugin is stored in the plugin folder and the link would look weird. Any ideas or suggestions would be greatly appreciated :)

Thanks for readin!

Roger

Cory.Nickerson on "using $_GET and $_POST in theme function.php?"

$
0
0

I tested out the following and it returns an empty array.

echo '<pre>';
print_r( $_GET );
echo '</pre>';

Does WordPress destroy all the $_GET and $_POST data prior to the themes function.php?

josefe03 on "show menu plugin to Suscriptor Role"

$
0
0

i create a plugin, This has a menu inside setting options where a page appears, as I show this page to subscribers.

tomwpumford on "Functions Custom Admin Page"

$
0
0

Below is a simple functions page which displays two custom wordpress dashboard menus. One main menu and a submenu.

As you can see both pages (main and sub) have an input, one for name and one for email.

Question as follows 1. Is there a way to simplify so i dont have to register 2 settings, 1 for each page? 2. What is the best way to show this frontend on the theme.

<?php

/* Add Page */

add_action('admin_menu', 'settings' );
add_action('admin_init', 'register_settings_page');
add_action('admin_init', 'register_settings_sub_page');

/* Add to WP admin menu */

function settings() {
add_menu_page( 'Settings Page', 'Settings Page', 'manage_options', 'settings-   page', 'settings_page');
add_submenu_page( 'settings-page', 'Settings Page Sub', 'Settings Page Sub', 'manage_options', 'settings-page-sub', 'settings_page_sub');

/* Register Settings */

function register_settings_page() {
register_setting('settings-page-reg', 'settings_name');
}

function register_settings_sub_page() {
register_setting('settings-sub-page-reg', 'settings_email');
}

/*Add Content for Pages */

function settings_page() {
?>
<form method="post" action="options.php">
<?php settings_fields('settings-page-reg'); ?>
<label>Settings Page Input</label>
<input name="settings_name" type="test" value="<?php echo get_option('settings_name'); ?>" />
<input type="submit" value="<?php _e('Save') ?>" />
</form>
<?php
}

function settings_page_sub() {
?>
<form method="post" action="options.php">
<?php settings_fields('settings-sub-page-reg'); ?>
<label>Settings Sub Page Input</label>
<input name="settings_email" type="test" value="<?php echo get_option('settings_email'); ?>" />
<input type="submit" value="<?php _e('Save') ?>" />
</form>
<?php
}
}
?>

<html>
<body>
<h1>I want name here</h1>
<p>I want email here</p>
</body>
<html>

ph34r on "CPT with Custom Categorical Hierarchy"

$
0
0

Hello,

I'm building a review website, for which I've defined a Custom Post Type: Review. The goal is to be able to categorize the reviews by a parent category and a child category:

website.com/reviews/parent-category/child-category/actual-review

In this configuration, all reviews will be categorized by a child category (which obviously has a parent category). Navigating to the parent or child category (website.com/reviews/parent-category or website.com/reviews/parent-category/child-category) should present the user with a standard Wordpress archive page.

I've tried to figure out how to do this using taxonomies, but have not been successful. To date, I've only successfully written the definition for the Custom Post Type, see below. What is the best way of achieving this basic functionality?

// Register 'Review' custom post type
add_action( 'init', 'review_create_post_types' );

add_post_type_support( 'review', 'genesis-layouts' );

/**
 * Custom 'Review' post type
 */
function review_create_post_types() {

	register_post_type( 'review',
		array(
			'labels' => array(
				'name' => __( 'Reviews' ),
				'singular_name' => __( 'Review' )
			),
			'public' =>  true,
			'has_archive' => true,
			'taxonomies' => array('post_tag'),
			'rewrite' => array(
				'slug'=>'reviews',
				'with_front'=> false,
				'feed'=> false,
				'pages'=> false
			),
			'capability_type' => 'page',
			'hierarchical' => true,
			'menu_icon' => 'dashicons-video-alt',
			'supports' => array(
				'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments', 'revisions', 'page-attributes', 'custom_fields', 'genesis-cpt-archives-settings'
			)
		)
	);

}

OrbiTorbi on "comments for draft posts"

$
0
0

Hey guys,

im looking for a way to allow comments on draft post (at the backend).
The reason is that my customer need a way to comment draft posts for other people in the company. Is there a special hook or filter?

The only solutions i found was editing the core file (in my opinion very bad idea)

Any ideas?


guillaumemolter on "Adding extra parameters to auto embeded Youtube urls"

$
0
0

Hi,

I would like to enable the js api to embeded youtube vidéos.

Youtube's documentation states that you have to add enablejsapi=1 at the end of your src url.

So I'm trying to find a filter that would allow me to automatically append it to generated iframes when you copy paste a Youtube url in the editor.

I've been looking into wp_embed_handler_video and embed_defaults but I'm really sure what I'm supposed to do.

Does anyone as an idea? Or at least tell me where to look in the codex?

Thank you!

wrigs1 on "New WP Plugin Directory stats tab and a problem"

$
0
0

Hi

The revised download/install info provided on plugins in Wordpress.Org's plugin directory is a great improvement.

However; for one of my new plugins https://wordpress.org/plugins/country-caching-extension/stats/ instead of displaying a graphical representation of percentage installs by version, the message "Unable to get value of the property 'title': object is null or undefined" is highlighted in red.

Anyone know why this error?

Thanks for any info.

Guido on "Custom Style / CSS > save data to database"

$
0
0

Hi,

I am developing my own custom CSS function which I will use in my contactform, so users can change layout of form by adding custom css in a textarea field.

To add save data in database I use: sanitize_text_field
To display save data in textarea field in backend I use: esc_textarea

My question, the sanitize_text_field removes all line breaks (does not look nice in textarea field backend), can I use an alternative for entering save data in database?

This I use now:

register_setting( 'my_options_group', 'my_option_name', 'sanitize_text_field' );

Guido

milanparmar22 on "Any plugin to use own Custom thumbnail (not system generated)"

$
0
0

hi, i am using woocommerce with custom theme. i am not fine with system generated thumbnail image, single product image.

I want to manually create thumbnail and want to display it.

Is there any plugin for doing that?

I found one below, however, it is not working...

https://wordpress.org/plugins/thumbnail-uploads/

t_robinson on "Creating custom admin menu similar to 'Settings' page"

$
0
0

I'm currently running a multi-site instillation of WordPress and have a bundle of custom built plugins running which I am trying to tidy up within the admin area. Some sites require all of the plugins and some require none. I am working on creating a new plugin that adds a new admin page and lists all of the plugin's admin pages under this new page which doesn't want to be displayed if a site has no plugins activated.

I have created a custom 'Core' plugin with a prefixed version of the WordPress add_submenu_page function which acts in a similar way. This function created the parent menu each time the function is called (which means it will not create it if it already exists) and then will register a sub-page.

I have managed to get this all working however the parent page is listed as a sub-page under its self. I am looking to hide the parent page from the sub-menu and when clicked on from the left-hand menu, it will re-direct to the first admin page in the sub-menu however this doesn't seem to be going to plan.

Viewing all 8245 articles
Browse latest View live




Latest Images