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

tsusanka on "Replace administration search with my own"

$
0
0

On my website I have my own search implementation (using elasticsearch) and I use WP for administration only. In admin, in Posts section there is a search bar in the top right corner. I would like it to use my implementation of search rather than the default one.

I know there is a pre_get_posts action, however that is used to alter the search query. I would like to completely avoid that and call my own implementation, which returns a simple array of posts and pass it then as a search result.

Can this be done? The alternative is to remove the search bar completely and replace with my own. However, I didn't succeed in that either.


PaperMaster1 on "How to add article/post via external PHP code?"

$
0
0

I need to Add post/article from my local text files to a WordPress website via php script (that can make also parse raw text files to a WP format). Is there any API or something like that?

Nozibulla on "Clicking sub menu pop up a modal"

$
0
0

I am working on a wordpress plugin where i want to open a pop up modal when i click on one of my plugin sub-menu.I can trigger the modal using a link or a button.But I want to load the modal at the time i click on the submenu. I am new to wordpress and some demo code will be very helpful.

I tried using various way of using javascript like

<script type="text/javascript">
    $(document).ready(function () {
    	$('#modal_choose_ur_form').modal('show');
	});
  </script>

this is working for a simple HTML page quite well but not for my plugin. What can do can anyone help?

sunnyshark on "How to disable "wpautop" ONLY TO PAGE? (and not to posts?)"

$
0
0

I find this useful to add in functions.php to disable "wpautop".

remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );

But, I would like to have it process ONLY PAGES, AND NOT TO POSTS.

How is that possible?

Chris Huff on "Don't trim space at the end"

$
0
0

Via my plugin's settings page, I'm trying to save a string the database that has a space at the end of the string, which I want it to have. But when it saves it to the database, it trims the space off of the end. Is there a way to tell it to keep the space at the end?

Here's some relevant code:

function afift_settings_page() { ?>

<form method="post" action="options.php">
    <?php settings_fields( 'auto_featured_image_group' ); ?>

    <p><label for="auto_image_before_text">Additional Character(s) Before Text:</label>
    <input name="auto_image_before_text" type="text" size="5" id="auto_image_before_text" value="<?php form_option('auto_image_before_text'); ?>" /></p>

    <p><input type="submit" value="Save Changes" /></p>
</form>

<?php }

jim2k on "Show related posts by category"

$
0
0

Is there a simple, plugin-free way of showing a number of related posts from the same category on the single.php page (without showing the current post as part of the list, of course)? Perhaps using wp_query?

I've tried a bunch of things and the tutorials out there are all several years old and don't really work.

Thanks in advance!

jitheshkt on "Displaying Widget title in it's settings screen"

$
0
0

Hi, Look at the screen shot. First widget is created by me (Okey, I admit that I copied it from internet :P). Second one is someone's else. See his widget is displaying the title of the widget along with its name. But mine doesn't. What I am missing ? What is the exact action/hook responsible for this ? I compared my code with the other one. Can't find anything missing. I will post my source if needed. But I think this is some kind of action/hook. Please help.

Screen shot : http://i.imgur.com/VJ6dZzG.png

alardone on "Porno en los links de mi blog desde Móbil"

$
0
0

Hola!

Quisiera saber cómo solucionar el problema que surge desde dispositivos móbiles.

Cuando entran vía celulares los links llevan a sitios pornos.

Cómo puedo solucionarlo?

Gracias!


diveman1 on "How to implement a URL API in Wordpress"

$
0
0

Dear Sir/Madam, I'm currently working on a wordpress multi-site where the online ordering system (e-commerce) is a separate website and database. The goal is to get data from the online ordering system to display on the Wordpress multi-sites. The online ordering system has an API that is a URL. As an example:

URL for account holder registration:
http://domain/clothing/accountHolderRegistration.html?cloId=123

URL for the services : http://104.224.181.39:8181/cxs/api/apiService

Headers
authorizationtoken : 2bc20e778efb916a782282236ae27983

Service for fetching the details of individual clothing item:
Input Parameters
consumerName : clomicrosite
data : {"clothingId " : "1"}
serviceName : getClothingDetails
Output
{
"success" : true,
"clothing":{
"clothingDisplayName" : "clothing 1",
"clothingSize" : "Large",
"clothingColor" : "Red",
"clothingPrice" : "$25.00"
"clothingPhoto" : " this will be a large base 64 string",
"testimonials" : [
{"whoSaid" : "xyz",
"whatSaid" : "This is Good"
},
{"whoSaid" : "abc",
"whatSaid" : "This is Bad"
},
{"whoSaid" : "xyz",
"whatSaid" : "This is Average"
}
]
}
}

I know this is probably a dumb question but I'm trying to figure out how to now display this information on a Wordpress page. I'm not sure how to call the API and provide the authentication token, and then parse and display the clothing data. Can anyone help? Any help is very much appreciated. Thanks in advance.

Bernstein09 on "Spam in the web description"

$
0
0

Please help, anyone!

When you google my website, it comes up and the description below it is all spam.

When you click on the website to load in the cache option it is the website with spam at the top of the page.

Any help would be appreciated!

~ Steve

Guido on "Messages go directly in junk folder. Caused by return-path?"

$
0
0

Hi,

Because messages send from my contactform often directly go to the junk folder I Googled this and found out this might be caused by the 'return-path' (domain) not being the same as email (domain) from sender.

The return path is part of phpmailer, and gets the website/server domain.

So I created this hook (source) to turn the return-path into email from sender.

function my_phpmailer_example( $phpmailer ) {
	$phpmailer->Sender = $phpmailer->From;
}
add_action( 'phpmailer_init', 'my_phpmailer_example' );

It does change the return-path (same as email from sender) but I would like to now if this really does the trick? Any thoughts?

Guido

Mac8myPC on "How are woocommerce global attributes stored in the database?"

$
0
0

I'm working on a website for a client that has over a hundred wood and fabric choices on their site. Adding the attributes and variations product by product was becoming a nightmare, so I opted for a simpler approach. I'm hand coding a pop up window where the visitor can pick their wood and fabric choices from a window that displays the global attributes available. For example, the visitor picks oak, then clicks a field to enter the swatch choice and a window pops up allowing them to pick from some global attributes that have been setup in the shopping cart admin.

I haven't been able to decode how the attributes are tied together in the database. The ID's for the attributes (stored in the posts table) don't seem to correlate with the ID's in the woocommerce attributes or taxonomy tables. I need to figure out how they're tied together so I can pull the appropriate swatches based on which wood type the visitor chooses.

Please let me know if you need more clarification on this and thanks in advance for any help!

DidiDev on "Announcements / specific classified ads"

$
0
0

Hi,

I am a php developer, and more used to work with Frameworks rather than CMS, but we decided to work with Wordpress for a new project :)

This project is a website for a music association, and the part I'm working on is the page were musicians can look for groups and groups look for musicians. It's sort of a craigslist specific to music, with fields that are specific to music and especially the music genre the association is dedicated to.

The way I would have done it with a framework or with bare php is :

  1. Create a data model for groups / musicians posts (SQL tables)
  2. Create CRUDs (Form to create, read, update and delete these posts)
  3. Create a page listing the posts and letting users do basic search (simple sql queries) to find their perfect group/musician

But I thought it would be smart to, first, ask the community if some steps of this work had already been done in open source or free pulgins, or if you guys had some advice about how to design such a page with wordpress.

I think I should also tell you that I already spent few hours looking for free plugins but could not find anything that would suit my needs : regular user postsing custom content with custom fields, and model storing it in order to be queried easily. (some free pugins I looked : Advanced custom fields, Pods, Ninja forms, User submitted posts)

Thank you in advance for you help !

Adrien

cyberlp23 on "Onclick when selecting a category in post admin UI"

$
0
0

Hello,

What I'm trying to achieve is the following: when a user is creating a new post, when he clicks to select a category, to display custom taxonomy box related to that category.

I guess I have a add a simple onlick/showdiv command to the category select field, but how do I hook post.php to do this?

Thanks.

Show Up Strong on "Remove/hide page title from all pages"

$
0
0

I have tried everything to remove the page titles from showing and nothing is working. I'm using every code I've tried in the past that's worked and after hours of trying, I need help.

Additionally, the code that's always worked to make pages full width isn't working either.

My site is showupstrong.com Any help would be greatly appreciated.


oleggen on "wp oauth website client connection"

$
0
0

I'm not sure it's the right place for this question so if not please direct me to the right one.

[ Moderator note: moved to Hacks. ]

I'm building a cool webapp and instead of developing my own content and user management system I have decided to give WordPress a shot.

I have my script running from dev/script.php and I installed WordPress on dev/wp/. When accessing basic functionality like querying posts everything works like a charm but to log in I need to connect to the json-api via oauth1.

I have installed both plugins (wp-json and oauth1) and I want to connect my app. My question is: how? I have read everything the documentation has to give me and I found it to be skipping some basic steps.

On this article it says that I should create a consumer and that in order to create one I need to run the following code on my server.

$ wp oauth1 add

ID: 4
Key: YYYYYYYY
Secret: XXXXXXXXXXXXXXX

What is this code? should I run it simply from the command line, or on a specific folder? And using the same key and secret as the rest of those who read this tutorial is quite a security issue, isn't it?

luciole135 on "Impossible to optimize an InnoDB data table with the $wpdb class?"

$
0
0

Hello
To optimize an InnoDB table, just run a query in the phpMyAdmin SQL tab. (for example):

ALTER TABLE wp_posts ENGINE = InnoDB

And it work !

But when you run this same query with the $wpdb class, it does not work!

$result = $wpdb-> query('ALTER TABLE '.$table_name->Name.') ENGINE = InnoDB');

How do I optimize an InnoDB table with the $wpdb class?

tejli007 on "New link on refresh? is this possible?"

$
0
0

Hello Everyone.

Am about to create a plugin and i need the hack how to generate a new post link by every refresh?

I mean: when you get in into post you get http://www.somesite.com/?p=123

When i refresh the page, i want to get ?p=512

It must not be this method with the numbers, it can be also letters or any other characters.

I know, i will get many 404 pages, thats not a problem.

Thank you everyone!

SJS719 on "How to Split Single Text into Multiple Lines"

$
0
0

Hey guys,

I am designing a business directory site like YP and I am trying to display a business’s address on multiple lines within the business’s “listing” page. I am displaying the address using the function
<?php the_listing_categories(); ?> which works great to display the business address within the post, but it displays the address on 1 line and I need it on multiple lines.

Currently Displayed as:
2555 Grandview Rd., Colorado Springs, CO 80910, USA

To be displayed as:
2555 Grandview Rd
Colorado Springs, CO 80910, USA

I would also like to be able to add another line if the address has a Suite or Room # such as:
2555 Grandview Rd.
Suite #10
Colorado Springs, CO 80910, USA

Any ideas?

cocacooler on "how to use post"

$
0
0

Hi Guys,

I need some help to check if Myvalue is in the post or not, and this is what the plugin author has provided me, i have to make this code check in each post$ ..

can someone help me make the check for post .. so i can copy/paste it into my functions.php

$settings = new my_Settings_Post_Meta($post->ID);
if($settings->{'MyValue'})
{
echo "The value is there"
}
else
{
echo "Value not there"
}

The reason why i have written this post here is because there are no support topic for this plugin, its a custom change and the coder wants a lot of money to make this simple function

Viewing all 8245 articles
Browse latest View live




Latest Images