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

Eliot Akira on "WYSIHTML5 instead of TinyMCE"

$
0
0

I have an idea about using WYSIHTML5 editor in the post edit screen, as an alternative to TinyMCE.

One challenging part might be integrating the Add Media button, and dealing with images.

If anyone else is interested in the idea, I would love to work together on it. I'll start by putting together a basic version as a plugin.


Doremdou on "Widget Form with results in a new page (plugin specific page)"

$
0
0

Hello everyone :)

I would like to create a plugin with a widget where people will complete a form.

Form example:
- Name
- Age:
- What do you like: movies, books, cars

and when they press submit, it will show the results on the specific plugin page (so I have to create that page too...) but it will fulfill a sentence already made.
For example on that plugin page, the basic sentence is:
Hi, my name is [Name], I am [Age] y/o, and I like [].

So when the user submit his form, the sentence will be completed with what he choose.
But I don't want the page to be permanently changed, I just want it to change dynamicly, like a search results.

I don't know really much about php and widgets, so that is why I am asking for help. I am not asking to do it for me, just give me advices or show me an example somewhere; I don't know, because I am a bit lost for the moment ^^
Thank you very much :)

Robert.Vidrine on "Theme update no longer works: "A valid URL was not provided""

$
0
0

I have hooked into the normal WP theme update process for enabling one-click updates to my theme which is not hosted at wordpress.org, but a recent update (3.7 I believe) has broken my update process, apparently because the URL from which I'm hosting the update does not pass some sort of check. (The URL is indeed valid, and the code which works in WP 3.5 no longer works in the recent two versions.) I have not yet installed a fresh version of 3.6 and 3.6.1 to see if the update works there, but based on the release notes, it looks like the additional security checks to the update process were probably added in 3.7.
I have searched and searched and cannot find where this new check is happening, so I'm hoping that someone can point me in the right direction.

When I attempt to update my theme:

  • WP reports that it is downloading my theme from a URL that resolves correctly if I copy/paste into a browser.
  • It displays the message "Download Failed. A valid URL was not provided."
  • The update process exits without downloading anything or modifying any files.

Any assistance finding where this error is thrown, what URL check my theme "repository" URL is failing, or any other help tracking this down would be greatly appreciated!

truheart on "FIltering posts based on custom taxonomies and categories"

$
0
0

Hey guys,

I'm trying to design a sidebar which lists links to the archive pages for posts based on specific categories and my custom taxonomy labeled "Topics". I have 4 Categories (Teachings, Posts, Media, Books) and multiple hierarchical "Topics" (i.e. Theology, Philosophy, History, etc.).

What is making this difficult is that each Topic belongs to multiple Categories. For example, I might have a post that reviews a historical biography (Category=Book, Topic=History), while at the same time have a post that contains a video discussing historical events (Category=Media, Topic=History). Using this example, what I am trying to do is make sure that for every time someone is on post or page that belongs to the Media Category, the sidebar is only listing taxonomies which will link to the videos and not the books. I hope that makes sense. If not here is an example of what I am trying to do:

(Sidebar when someone is on a media page)
Theology            (Cat=Media, Topic=Theology)
  -God              (Cat=Media, Topic=Theology->God)
  -Religions        (Cat=Media, Topic=Theology->Religions)
Philosophy          (Cat=Media, Topic=Philosophy)
  -Metaphysics      (Cat=Media, Topic=Philosophy->Metaphysics)
  -Ethics           (Cat=Media, Topic=Philosophy->Ethics)
etc...

cestbibi on "pre_get_posts doesn't work with pretty permalinks anymore"

$
0
0

Hi,
I have this in my functions.php to limit number of posts displayed for the "retrats" category :

function hwl_home_pagesize( $query ) {
    if ( is_admin() || ! $query->is_main_query() )
        return;

    if ( is_category('retrats') ) {
        $query->set( 'posts_per_page', 1 );
        return;
    }
}
add_action( 'pre_get_posts', 'hwl_home_pagesize', 1 );

Since upgrade to 3.8 that doesn't work anymore with pretty permalinks, only in default ones (then it works)
Someone noticed that already ?

Christiaan Conover on "get_plugin_data() is undefined function?"

$
0
0

I have the following code in my plugin's main file:

$_ENV['cc_author_plugindata'] = get_plugin_data( __FILE__, false );

I get the following error:

Fatal error: Call to undefined function get_plugin_data()

I'm inside wp-admin, so I'm not sure why this function isn't available. What's going wrong?

ADUpchurch on "Header.php Troubles"

$
0
0

I was having a problem with my site title repeating itself, and then I found this old thread that helped me out alot: http://wordpress.org/support/topic/wordpress-seo-yoast-duplicate-site-title?replies=17

As said in support I used replaced the code <title><?php wp_title(''); ?></title> in my header php and I stopped getting a repeated site title; YES! But something happened, a minor issue it seems. What happened is that part of my site title has blended leaked into my theme. The last guy that responded on the link I supplied you said that he fixed the problem, but he did not say how he did it. Please help me, my website is: http://www.creativesolvibrations.com

Sorry, I do not know how to use the link and code option here.

miketurco on "Diff between bloginfo( 'name' ) and bloginfo( 'description' )?"

$
0
0

I'm trying to replace the site header and tagline with category name and description, based on post category.

The code, below, works fine on category pages. It replaces both the title and the tagline.

On posts within a category though, the category name replaces the site headline, but the category description doesn't replace the tag line.

Here is a category page (works right): http://miketurco.com/consulting-services/

Here's a post within a category. The title is replaced but the tagline is not:

http://miketurco.com/vendor-referrals-and-management/

This is the code:

<?php if (is_category() || is_single() ){ ?>
                    <span class="home-link">
                    <h1 class="site-title"><?php the_category(' '); ?></h1>
                    <h2 class="site-description"><?php echo category_description(); ?></h2>
                    </span>
                <?php } else { ?>
                    <a class="home-link" href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">
                    <h1 class="site-title"><?php bloginfo( 'name' ); ?></h1>
                    <h2 class="site-description"><?php bloginfo( 'description' ); ?></h2>
                    </a>
                <?php } ?>

Thank You!


Luc057 on "(Wordpress - Thrid software) Database integration"

$
0
0

Hi everyone!

I have a software made in C#.

In a certain part of my software theres a login system that grants the user some cool features if logged proprely.

I also have a website made in WP. I would like to know if theres a way to my users can use the same database to log in the software as they log in my website.

In other words, i would like that my users could use the same login in my software and in my WP website.

For testing, i've created a php script that logs in at any other database. but, i could not log in using the WP database because the password field is cryptografied.

Pls help, if theres no way to do that, and you have any new ideias about solving that issue, everything is wellcome!

Thanks!

brianoz on "Plugin generating virtual pages, issue with the_content not running"

$
0
0

I have a need to be able to generate fake/virtual/dynamic pages based on a url like http://www.mycinema.com/wpcinema/movie/MOVIEID to be able to display movies for cinemas with info on the movie and live session feed information.

After spending many hours researching, there doesn't seem to be much stuff written on how to do virtual pages in WordPress, so I will be writing up my experiences after getting this resolved!

So far, the current plan is to use the two filters - template_redirect to set the template to the current plugin's page.php template, and the_content to insert the content. The idea is to use the theme's template so the pages theme in well with the site.

(I got this approach from this excellent 2012 page from Xavi Esteve).

I have two problems:

  1. What is the best, most bullet proof, way to do this? Am I using the wrong approach? My thinking was that using the current theme's template was likely to provide the best current fit for the style of the website.
  2. TwentyTwelve does not appear to be calling the the_content filter in the context I'm using it. I suspect I'm doing something wrong, but cannot find the problem. This is probably closely related to question 1. TwentyTwelve definitely calls the_content for a normal page, and even an early add_filter() doesn't trigger in my code.

I discovered get_template_part() yesterday and wondered if I should be using that instead of manually looking in the child folder then the parent and running an include (not shown in the code below).

I wouldn't be asking, but I'm at my wit's end having googled extensively, possibly for the wrong search terms.

I've considered custom post types, but there are various complexities around this (including content that may change every few minutes) which means a dynamically generated page works much better.

This is an excerpt from the code I've written to explain the problem further:

add_action('parse_request', array(&$this, 'vm_parse_request'));

function vm_parse_request( &$wp )
{
    global $wp;
    if (empty($wp->query_vars['pagename']))
        return; // page isn't permalink

    $p = $wp->query_vars['pagename'];

    if (! preg_match("#wp-cinema/movie/([^/]+)#", $p, $m))
        return;

    // setup hooks and filters to generate virtual movie page
    add_action('template_redirect', array(&$this, 'vm_template_redir'));
    add_filter('the_content', array(&$this, 'vm_the_content'));
}

function vm_template_redir()
{
    // Reset currrently set 404 flag as this is a plugin-generated page
    global $wp_query;
    $wp_query->is_404 = false;

    $template = 'page.php';

    include(STYLESHEETPATH."/page.php"); // child
    // parent case left out for brevity

    exit;
}

function vm_the_content($content)
{
    return "my new content (actually generated dynamically)";
}

This is going to be an increasingly common thing in WordPress - can anyone offer suggestions or help? Anything is much appreciated.

emailscrewed on "[WordPress][PhoneGap]Audio Player buttons not visible in PhoneGap Application"

$
0
0

I am developing a Phonegap application of a site which is based on the WordPress. The site is sending me a JSON which is filled with the content. The problem is that the audio is also coming in the content. The audio is able to play in the application but there are no control buttons visible on the player. Just a big black bar comes with a seek when the songs is been completely loaded into the application.

Can any one help me to make those buttons visible. Already tried making changes to .htaccess file and tried changing the core media file icons from SVG to PNG.

But nothing worked. Can any one help out ?

WordPress version 3.7.1

3rdEyeGuam on "Force Change Plugin URL?"

$
0
0

Hello,
I am trying to get cookie free domains working 100% and I'm having trouble with the plugins url path.

I have tried define('WP_PLUGIN_URL', 'http://static.mysite.com/plugins'); but when I visit the main website it's still pulling the default website URL for plugins. This means all the .css and .js files from wordpress plugins are not cookie free.

I've searched all over the web for help but couldn't find what I'm looking for. What I need is a way to force wordpress to use my static-url for plugins url as well.

robthirlby on "pods where clause in do_shortcode"

$
0
0

Is it possible to quote the following pods shortcode in a do_shortcode call? It works ok without the where clause but gives a syntax error at the first { otherwise.

[pods name="author" limit="-1" where= "d.first_name like'%{@get.firstname}%' and d.last_name like'%{@get.lastname}%' "  ]
....html with various other{magic tags} ...[/pods]

I could clearly rewrite the whole thing in php pretty easily but would prefer to use the shortcode and magic tags. The code is in a page template.

alphamartin65 on "High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?"

$
0
0

High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?
High Profile Daman /Escort? ! 09871931389 ! Daman /Escorts?

vinoth06 on "Function takes more precedence over $content"

$
0
0

Hi,

Am working on $content to append some content from function. So I have added like this,

function one($content){
return $content.functionname();
}

add_filter('the_content','one');

functionname(){echo 'hello';}

Am getting output as
hello then only the content but actually it should be content then hello.

So functions take more precedence over the $content. Could you please give some solution to display like content and then function operations.


Hymer on "How to fix the full background in IE?"

$
0
0

My background in varosvedo dot hu is full and fixed. It fills the screen even zooming the view in every browser but not in IE. Please, tell me, how can I get the same effect in IE?

Canada4Life on "Post Comments to Page from another page"

$
0
0

Hello.

I have a page setup where users can post comments. I would like to remove the default post a comment form from the bottom of the page, and add it to another page. So filling out the form on page one would make the comments display on page two, and no comments would be displayed on page one. I haven`t modified WP code a lot, and am looking for a push in the right direction with some code I can use, and where to put it.

Thanks in advance.

kythuat.us on "needs to help for code page"

$
0
0

me have the following fragment codes:

[php] $args = array(
'depth' => 1,
'show_date' => '',
'date_format' => get_option('date_format'),
'child_of' => 588,
'exclude' => '',
'include' => '',
'title_li' => '',
'echo' => 1,
'authors' => '',
'sort_column' => 'post_date',
'link_before' => '',
'link_after' => '',
'walker' => '',
'post_type' => 'page',
'post_status' => 'publish'
); [/php]
[php] wp_list_pages( $args ); [/php]

how to display the page shown on the first line in the above code when I add a new page to its children?

sqhendricks on "Admin bar icons and wp_insert_attachment"

$
0
0

I have a function that runs after a form is submitted that creates an attachment to a post. However, after the form is submitted, the admin bar icons are replaced either by empty squares or odd characters. I have narrowed this down to the call to wp_insert_attachment.

When that fires off, and the page refreshes, the icons are garbled. If I go to another page, or reload the page, they're ok, but this is a bit disconcerting.

Any ideas why this might be happening? I'll be glad to provide some code, if that would help.

reto.kuepfer on "query custom post type by date"

$
0
0

Hi
I created a custom post type envent.
I d like to filter out post in the futere.
I did use the advanced custom fields plugin to make a date picker.
I used following code, but somehow id does not filter out the future post.
I'm thanksful for any sugestions.

<?php $events = new WP_Query(
     			array(
     	'post_not_in'    => array($donotrepeat),
        'post_type'       => 'chuchi_event',
     				'meta_key'        => 'event_datum',
     				'orderby'        => 'meta_value',
     				'order'           => 'dsc',
            'meta_query'  => array(
                  'key'     => 'event_datum',
                  'value'   => date("Ymd"),
                  'compare' => '<=',
                  'type'    => 'DATE'
                )
     		)); ?>

        <?php while($events->have_posts()) : $events->the_post(); ?>

                <?php $date = date_create(''.get_field('event_datum').''); ?>
                <p><?php echo date_format($date,'l d.m.Y'); ?></p>
                <a>" title="<?php the_title_attribute();
            	?>" >	

            <?php endif; ?></a>

[Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

Viewing all 8245 articles
Browse latest View live




Latest Images