Are you the publisher? Claim or contact us about this channel


Embed this content in your HTML

Search

Report adult content:

click to rate:

Account: (login)

More Channels


Channel Catalog


Channel Description:

WordPress › Support

older | 1 | .... | 398 | 399 | (Page 400) | 401 | 402 | .... | 413 | newer

    0 0

    Hello,

    I don't know how to create a link from one post to another. Just to be clear, I know how to do simple link in HTML and even PHP, but my example seems too much for me.

    Link for the live website: link

    On the bottom left corner you'll see a "Phoenix Pool & Spas" name on the blue background and I want this name linked to the "Phoenix Pool & Spas" post. For the moment it is linked to the "5474 Coach Ln" post, besically doing the same as "More details" button. I don't want permanent link, cause it's easy knowing the post ID, I want it to be dynamic. I hope it is possible.

    Here's the piece of code for this link:

    <div class="detail">
                <h5 class="price">
                  <a href="<?php the_permalink(); ?>">
                  <?php
                  $post_meta_data = get_post_custom($post->ID);
    
                    if( !empty($post_meta_data['REAL_HOMES_property_contractor'][0]) ) {
                    $prop_contractor = $post_meta_data['REAL_HOMES_property_contractor'][0];
    
                    echo '<span>';
                    echo esc_html( $prop_contractor );
                    echo '</span>';
                   }
    
                    ?></a>
                </h5>
                <p><?php framework_excerpt(12); ?></p>
                <a class="more-details" href="<?php the_permalink() ?>"><?php _e('More Details ','framework'); ?><i class="fa fa-caret-right"></i></a>
            </div>

    I hope to learn something here as well. Thanks for all the inputs.


    0 0

    When I ask for a post's meta value, it comes as an array or a string.

    Can I store an array of values?

    For example, if I have an array $postIDs=array(21,47,81,32), can I store it with update_post_meta($post_id, 'postIDs', $postIDs)?

    Currently, I'm joining the array into a string and storing that.

    $postIDstring = implode(",", $postIDs);
    update_post_meta($post_id, 'postIDs', $postIDstring);

    Then I'm extracting it:$postIDstrings=update_post_meta($post_id, 'postIDs');

    $postIDs=explode(",",$postIDstrings[0]);

    How does it work?


    0 0

    Hi,

    I got a theme done by a freelance dev and it was supposed to display the last issues of a custom taxonomy item.

    Here is the code:

    <?php $args = array('orderby'=> 'slug',
                                                      'order'=>'DESC',
                                                      'number' => '7',);
    
                                        $terms = get_terms( 'numero', $args );
                                        if ( ! empty( $terms ) && ! is_wp_error( $terms ) ) {
                                            $count = count( $terms );
                                            if($count > '1'){
                                                    ?>
                                                        <div class="archives_mag home_archives">
                                                        <h3>Previous issues </h3>
                                                    <?php
    
                                            $i = 0;
                                            $term_list = '';
                                            foreach ( $terms as $term ) {
                                                $i++;
                                                $taxo_mag = 'numero_'.$term->term_id;
                                                $image_mag = get_field('image_a_la_une ', $taxo_mag);
                                                $numero_mag = get_field('numero', $taxo_mag);
                                                $term_list .='<div class="elem_mag">';
    
                                                $term_list .='<a href="' . get_term_link( $term ) . '" title="' . sprintf( __( 'View all post filed under %s', 'my_localization_domain' ), $term->name ) . '"><img src="'. $image_mag['url'] .'" alt="'. $image_mag['alt'].'" /> Numéro '. $numero_mag .' : ' . $term->name . '</a></div>';
                                            }
                                            echo $term_list;
                                            ?>
                                                  <div class="clear"></div>

    Somehow it shows the last item and not the previous one (i have 2 items from that taxonomy so far...


    0 0

    Hi,

    I'm writing my first Wordpress plugin and still learning how to do it. There are two issues I need to solve first.

    I planned to write an inline related plugin that use shortcut to insert custom URL and get back title, a few sentences, custom thumbnail.

    So how can I do that? The questions are:

    - how to get post_id from provided permanent link
    - how to get a limitation of contents from provided post_id
    - how to get a custom thumbnail from post_id

    Thank you.


    0 0

    Hello everyone,
    I want to add into my website posts headings with colored background like this:

    imgur.com/qZze5DR

    It will be multiple heading in every post with different titles, i have the code to make the exact design, now i want to make a shortcode to summon the colored box and i just add a title, that's all :D

    I'm very newbie when it comes to coding, already tried some plugin generator but it didn't helped, I'd appreciate any help to make this 'small plugin' work, and thanks.


    0 0

    Hello,

    I made a custom taxonomy 'geboortelijst':

    if ( ! function_exists( 'geboortelijst_taxonomy' ) ) {
    
    // Register Custom Taxonomy
    function geboortelijst_taxonomy() {
    
    	$labels = array(
    		'name'                       => _x( 'Geboortelijsten', 'Taxonomy General Name', 'text_domain' ),
    		'singular_name'              => _x( 'Geboortelijst', 'Taxonomy Singular Name', 'text_domain' ),
    		'menu_name'                  => __( 'Geboortelijsten', 'text_domain' ),
    		'all_items'                  => __( 'Alle geboortelijsten', 'text_domain' ),
    		'parent_item'                => __( 'Parent iIem', 'text_domain' ),
    		'parent_item_colon'          => __( 'Parent Item:', 'text_domain' ),
    		'new_item_name'              => __( 'Nieuwe geboortelijst', 'text_domain' ),
    		'add_new_item'               => __( 'Nieuwe geboortelijst', 'text_domain' ),
    		'edit_item'                  => __( 'Bewerk geboortelijst', 'text_domain' ),
    		'update_item'                => __( 'Update geboortelijst', 'text_domain' ),
    		'view_item'                  => __( 'Bekijk geboortelijst', 'text_domain' ),
    		'separate_items_with_commas' => __( 'Verschillende lijsten scheiden door komma\'s', 'text_domain' ),
    		'add_or_remove_items'        => __( 'Geboortelijst toevoegen of verwijderen', 'text_domain' ),
    		'choose_from_most_used'      => __( 'Choose from the most used', 'text_domain' ),
    		'popular_items'              => __( 'Populaire geboortelijsten', 'text_domain' ),
    		'search_items'               => __( 'Geboortelijst zoeken', 'text_domain' ),
    		'not_found'                  => __( 'Niet gevonden', 'text_domain' ),
    		'no_terms'                   => __( 'Geen lijsten', 'text_domain' ),
    		'items_list'                 => __( 'Geboortelijsten', 'text_domain' ),
    		'items_list_navigation'      => __( 'Items list navigation', 'text_domain' ),
    	);
    	$args = array(
    		'labels'                     => $labels,
    		'hierarchical'               => true,
    		'public'                     => true,
    		'show_ui'                    => true,
    		'show_admin_column'          => true,
    		'show_in_nav_menus'          => false,
    		'show_tagcloud'              => false,
    		'query_var'                  => 'geboortelijst',
    	);
    	register_taxonomy( 'taxonomy', array( 'post' ), $args );
    
    }
    add_action( 'init', 'geboortelijst_taxonomy', 0 );
    
    }

    I would like listing all the terms from the custom taxonomy on a page. I find this code:

    // your taxonomy name
    $tax = 'post_tag';
    
    // get the terms of taxonomy
    $terms = get_terms( $tax, [
      'hide_empty' => false, // do not hide empty terms
    ]);
    
    // loop through all terms
    foreach( $terms as $term ) {
    
      // if no entries attached to the term
      if( 0 == $term->count )
        // display only the term name
        echo '<h4>' . $term->name . '</h4>';
    
      // if term has more than 0 entries
      elseif( $term->count > 0 )
        // display link to the term archive
        echo '<h4><a href="'. get_term_link( $term ) .'">'. $term->name .'</a></h4>';
    
    }

    With the variable post_tag the code works very well.
    Replacing the variable post_tag to geboortelijst, but nothing showing.

    How can i showing all the terms from geboortelijst ?

    Christophe


    0 0

    So i was wondering how i can achieve something like in here:
    goodmove.co.uk
    - you can type any text in "post code" field and click "go", after that page goes to form, where "post code" is already filled with text typed on front page.

    I was thinking about using that with contact form 7, since it's giving different ID's for each field, but i don't even know how to start.

    Would appreciate any help in that matter.


    0 0

    Please I need help.
    The code below will search for users with "jo*" in their username or email and display their usernames. The issue now is that I don't want to search any of those fields, i want it to ONLY search for users with "jo*" in their first_name and display their usernames.

    I understand it can be done with get_userdata function, someone should please help me with the right code to do it.

    <?php
    
    $blogusers = get_users( array( 'search' => 'jo*' ) );
    
    foreach ( $blogusers as $user ) {
    	echo '<li>' . esc_html( $user->user_login ) . '</li>';
    }
    ?>

    0 0

    Hi All,

    Recently I have been working on a Font Awesome social sharing sidebar plugin, very similar to this style:

    https://en-gb.wordpress.org/plugins/custom-share-buttons-with-floating-sidebar/screenshots/

    Now then, I was testing my plugin and saw that it only appears on posts/pages, when I navigate to the front page, or blog feed the sidebar isn't there, I am relatively new to Wordpress loops, but I imagine this is something simple that I have missed.

    So what I am looking for is the sidebar to appear on every page / category / post and the front page.

    Here is the function and return code from the plugin:

    function add_social_share_icons($content) {
        $html = "<ul id='social-sidebar'>";
    
        global $post;
    
        $url = get_permalink($post->ID);
        $url = esc_url($url);
    
        if(get_option("social-share-facebook") == 1)
        {
            $html = $html . "<li><a class='fa fa-facebook' target='_blank' href='http://www.facebook.com/sharer.php?u=" . $url . "'><span>Facebook</span></a></li>";
        }
    
        if(get_option("social-share-twitter") == 1)
        {
            $html = $html . "<li><a class='fa fa-twitter' target='_blank' href='https://twitter.com/share?url=" . $url . "'><span>Twitter</a></li>";
        }
    
        if(get_option("social-share-linkedin") == 1)
        {
            $html = $html . "<li><a class='fa fa-linkedin linkedin' target='_blank' href='http://www.linkedin.com/shareArticle?url=" . $url . "'><span>LinkedIn</span></a></li>";
        }
    
        if(get_option("social-share-google") == 1)
        {
            $html = $html . "<li><a class='fa fa-google gplus' target='_blank' href='https://plus.google.com/share?url=" . $url . "'><span>Google+</span></a></li>";
        }
    
        if(get_option("social-share-mail") == 1)
        {
            $html = $html . "<li><a class='fa fa-envelope github' href='mailto:?body=" . $url . "'><span>Email</span></a></li>";
        }
    
        $html = $html . "</ul>";
    
        return $content =  $html . $content;
    }
    
    add_filter("the_content", "add_social_share_icons");

    I can imagine that the problem is something to do with the filter, or return, but I could be wrong. I have already tried if statements, but had no luck with them.

    Any help would be greatly appreciated.

    Thanks.


    0 0

    Hi there,

    I'm looking for a way not to display certain comments which have a specific comment meta and could not find relevant information on the web. What would be the best way to achieve it?

    The filter comment_text allows us to remove/modify comment text but not to completely remove the comment container element.

    Thanks in advance.


    0 0

    I'm not much of a coder, so am struggling to create a function (in functions.php) that will allow me to display the excerpts for posts in one category and the full post for another category. Here's what I have so far. The excerpts for category 8 displays, but other categories display the words "the_content".

    // show full post or excerpt on categories
    function post_length_choice($content) {
    //    if (is_category( array(1, 22, 23))) {
         if (is_category(8)) {
             $content= 'the_excerpt';
         } else if  (is_category()) {
             $content= 'the_content';
         }
         return $content;
    }
    add_filter('the_content', 'post_length_choice');

    0 0

    i have wordpress setup to send a post from the front end. I would like to avoid having to approve each submission. I'am aware of the potential downfalls of such a setup. even logged in as an admin, when submitting to the front end, I have to go into the admin are to approve the post.

    Is there a hack of some sort to allow the post to be approved right away?


    0 0

    I am looking for a php code which automatically creates a username for EACH visitor that views my site.

    After creating the user it should auto login.

    Username can be created from date, time, ip, or whatever

    Is there a simple way to do this, which enables me to autoregister visitors and allowing them to add email address if they find the site interesting?


    0 0

    So, like many other SEO-minded people who are hard-coding their schema into their posts, I've found that the TinyMCE editor automatically strips schema markup when switching between Text and Visual post editor views, which is frankly incredible in 2016.

    After some searching, I found this partial solution, which is apparently taken from here. As one of the commentators on the latter page points out, there is a small error in the code, which is corrected as follows (with some code added):

    // Prevent TinyMCE from stripping out schema.org metadata
    function schema_TinyMCE_init( $in ) {
    	/**
    	 *   Edit extended_valid_elements as needed. For syntax, see
    	 *   http://www.tinymce.com/wiki.php/Configuration:valid_elements
    	 *
    	 *   NOTE: Adding an element to extended_valid_elements will cause TinyMCE to ignore
    	 *   default attributes for that element.
    	 *   Eg. a[title] would remove href unless included in new rule: a[title|href]
    	 */
    	if( ! empty( $in['extended_valid_elements'] ) ) {
    		$in['extended_valid_elements'] .= ',';
    	}
    
    	$in['extended_valid_elements'] .= '@[id|class|style|title|content|itemscope|itemtype|itemprop|datetime|rel],div,dl,ul,ol,dt,dd,h2,h3,h4,li,link,meta,span,a[rev|charset|href|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur]';
    
    	return $in;
    }
    add_filter('tiny_mce_before_init', 'schema_TinyMCE_init' );

    Now, I should also mention that in my search, I found this workaround to simply add a Custom Field with the desired schema markup. However, this is not a proper solution for me, because it doesn't allow you to enter the markup directly into the post body.

    All schema elements seem to work for me so far, except for the <meta> element. I'm a bit dumbfounded why this element alone fails to work (with or without the optional closing "/"), so I was wondering if anyone could enlighten me as to why this is, and hopefully even provide a solution.

    Thanks for your time!


    0 0

    Hello there,

    My website was hacked, and as a result in Google search I had link to my website like in this format: mydomain.com/?12345678

    This page although does not exist in my WordPress website, DOES NOT lead to page 404, instead it goes to my home page.

    If I remove ? than it does go to 404.

    I tried installing plugin "404 page - your smart custom 404 error page" But it did not help.

    What can I do, so that link goes to 404?


    0 0

    Hello everybody.

    Using the **Toolset Types** plugin, I've created some custom post types with their relatives custom fields. I'd like to display a nav menu on my site with the list of the "pages" I've created under a certain **Custom Post**.

    By registering a new menu in my functions.php theme file, I managed to do that, no problem till that point. Now I'd need to**display a custom field** as an <img></img> tag inside the <li></li>
    outputted by the WordPress core nav.

    I'm not an expert when it comes to php, but I can hack my way around it.
    Any help will be much appreciated.

    Thanks.


    0 0

    Hello everyone, it's quite surprising (at my level)!

    By looading a plugin I develop, I instantiate an object whose constructor initializes a hook as follows:
    function __construct () {
    add_action ( 'template_redirect', array ($this, 'my_redirect'));
    add_action ( 'current_screen', array ($this, 'my_redirect'));
    }

    The method 'my_redirect' overwrites 'wp_redirect' as follows:

    ` my_redirect function () {
    .... Some preparation work..
    wp_redirect (admin_url ( 'profile.php'));
    exit; }`

    This works fine: that is, just after he logs in, the user is redirected to its profile page, in the administration part.

    THEN I tell myself that if I want to redirect to a page in the 'front-end', I have to write:
    ` my_redirect function () {
    ...
    wp_redirect (site_url ( 'mypage.php'));
    exit;}`

    Well, no ! the browser returns "page is not redirected correctly!"
    (I precise that the url is valid, of course).

    Would you know why ?? Any help will be greatly appreciated .... thank you in advance
    Pierre


    0 0

    i have added ajax code in my theme template but it,s showing me error if i change permalink to plain it,s working fine.I tried that with other themes too but same error showing.
    On older wordpress it,s working fine with all permalinks.
    my ajax code is

    jQuery(function(){
    	jQuery('#submit').click(function(e) {
    		var site = jQuery('#url').val();
    			curl = window.location.href;
    			jQuery.ajax({
    				type: 'GET',
    				url:curl,
    				data:{site:site},
    				success: function(bdata){
    					alert(bdata);
    				},
    				error: function(bdata){
    					alert('error');
    				}
    
    			});
    
    	});
    
    });

    0 0

    Hello!
    Created textarea field use wp_editor

    $settings=array(
    			'wpautop' => 0,//применять функцию wpautop
    			'media_buttons' => 1,//включить медиакнопку
    			'textarea_name' => 'description', //нужно указывать!
    			'textarea_rows' => 7,
    			'tabindex'      => null,
    			'editor_css'    => '',
    			'editor_class'  => '',
    			'teeny'         => 0,
    			'dfw'           => 0,
    			'tinymce'       => 1,
    			'quicktags'     => 1,
    			'drag_drop_upload' => false
    		);
    		wp_editor($_POST['description'], 'editdescription', $settings );

    and this field not supported embed video link from youtube,
    editor for post supported it.
    Why my redactor not provide it ???

    This is screen where video not embedded, How me on this functionality to my costume editor ???
    http://prntscr.com/bv6faa
    how you can see, video not add :(


    0 0

    I want to Use Content Keyword in Title How can i use them programmatically.
    I am using that keyword in h2 tags and those content is in numeric number

    Is there any way that i can place that in Title .

    Thanks


older | 1 | .... | 398 | 399 | (Page 400) | 401 | 402 | .... | 413 | newer