Search the Community
Showing results for tags 'tags'.
-
For a long time, I think I have been using heading tags wrong on websites. They always show like this on Google. Websitename websitename.com/category?name=mystery Posted by Night Flyer; 7 days ago; 5 views. « first; « prev; 1 of 1; next »; last ». Contact Us; @ 2014 websitename Inc. All Rights Reserved. As you can see, Google takes all the heading tags on my page and puts them in the description of the search result. So I have finally come to the conclusion that I should not be using heading tags for those things. Am I correct on that?
-
Are either of these OK depending on circumstance or stupid things I should never do? Is one or the other sensible/idiotic? Is there an obvious 'better' way? I think all the php tags opening and closing within the DIVs is untidy but it's static HTML therefore if there's a LOT of it it's easier on the server right/wrong? On the other hand, maybe all the open/close of php tags defeats the object. I'm applying for a web design apprenticeship (I know, I need one) so I'm trying to appear less stupid as much as make nice php. Many thanks in advance, I know I'll end up better off by asking here <?php // php in here ?> <div class='content header'> <?php include("includes/header.php"); ?> </div> <div class='content content1'> <?php include("includes/intro.php"); ?> </div> <div class='content content2'> <?php include("includes/quals.php"); ?> </div> <div class='content content3'> <?php include("includes/experience.php"); ?> </div> <div class='content content4'> <?php include("includes/hobbies-and-interests.php"); ?> </div> <?php // More php here ?> Or this one: <?php print("<div class='content header'>"); include("includes/header.php"); print("</div> \r\n <div class='content content1'>"); include("includes/intro.php"); print("</div> \r\n <div class='content content2'>"); include("includes/quals.php"); print("</div> \r\n <div class='content content3'>"); include("includes/experience.php"); print("</div> \r\n <div class='content content4'>"); include("includes/hobbies-and-interests.php"); print("</div> \r\n"); ?> test.zip
-
Hey Everyone. I am hoping this is the right place to ask this question. I am using a new WordPress theme and it has native related post coding in it. The problem is the code uses Post Tags as the selection value instead of Post Category. I was wondering if anyone could help me with this strip of code. I want to change it so the theme gets Posts in the same Category, instead of Posts with the same Tags. * Display related posts. * * @return void */ function stag_related_posts() { global $post; if( stag_rcp_user_has_no_access() ) return; if( ! stag_theme_mod( 'post_settings', 'show_related_posts' ) ) return; $tags = wp_get_post_tags( $post->ID ); if ( count( $tags ) ) { $tags_ids = array(); foreach($tags as $individual_tag) { $tag_ids[] = $individual_tag->term_id; } $query = new WP_Query( array( 'tag__in' => $tags_ids, 'post__not_in' => array( $post->ID ), 'posts_per_page' => absint( stag_theme_mod( 'post_settings', 'related_posts_count' ) ), 'caller_get_posts' => 1 ) ); // Add filter to attach 'post-grid' class add_filter( 'stag_showing_related_posts', '__return_true' ); if( $query->have_posts() ) : echo '<section class="related-posts" data-layout="2-2-2-2">'; while( $query->have_posts() ) : $query->the_post(); get_template_part( 'content', get_post_format() ); endwhile; echo '</section>'; endif; } wp_reset_query(); remove_all_filters( 'stag_showing_related_posts' ); } I've tried simply replaces the words Tags with Categories, but it doesn't seem to do much. Any help would be greatly, greatly, appreciated.
-
Right now I am using a session to get search's input terms and place them into meta tags(title). It works; the only issue is that the search terms lag 1 page behind. For eg. If i search "flowers" on first try, it will show flowers in the metas(title). Next I input "treehouse" in search; instead of "treehouse" showing in the metas, it'll still show me the previous term "flowers". Now if I do a third search with a new term, it won't show the new term in metas, it'll show me the previous term "treehouse". Why is this happening? Am I doing something wrong? This is only an issue with meta tags. Search itself works fine. It shows results on a page as it's suppose to.
-
Hello everyone, I have "Posts" table in my model. "Posts" table have these columns : ID , title , image , category , description , body , author , created_date. I want to extend my "Posts" table by adding a column "tags". I want my php website to compare one post with others by "tags". Is it this option good? or I must make a different table with foreign keys and tags. Please anwser me if you can the mySQL queries and the right database Model. Thenks
-
I am retrieving text and HTML tags from a database while using this function to encode the values for the browser. foreach ($row as $key => &$value){ $value = htmlspecialchars_decode( htmlentities($value,ENT_QUOTES), ENT_NOQUOTES ); } Basically, I am looping through each row and converting quotes, single quotes, and other special characters to entities while keeping HTML tags. However, when there's tags like <a href="example.com"> the quotes are duplicated twice and outputs to this: <a href=""example.com""> What am I doing wrong?
- 2 replies
-
- htmlentities
- htmlspecialchars
- (and 3 more)
-
Pass Parameters From Index.php Tag To Header.php Meta
donrobertito posted a topic in PHP Coding Help
Hello there! I'm such a beginner in php coding, i don't know the trick yet. My question is: I have a site, the main files are header.php; index.php; footer.php. I include header and footer in index php The index.php contains the articles, with tags. I want to pass the tags form articles to header.php as meta information. I get the tags from a database query. How can i do this method? Thanks: Robert -
Helllo: Need to add the html tag <li>...</li> to this plz: preg_match('/^[a-z0-9_\/a\-\ ]+$/si',$va1) Thanks.
- 17 replies
-
- preg_match
- html
-
(and 1 more)
Tagged with:
-
Hello, My name is Steve and I just joined up here. Looks like a good community so far. I am learning PHP and use Wordpress alot and I would like some help with an issue I'm having. Apologies if this is in the wrong section. I would like to output tags that I have preset in the backend, into a dropdown list on the frontend. Think of a profile page where a user can select an option from a dropdown, well I would like the tags to appear here for the user to select from. There are however a couple of requirements. If the user changes the dropdown value it needs to submit this to the Database so that the value is set to the new option. Also if a user wanted to choose more than 1 tag up to a maximum of 5, how could I add into the code if the user clicks a small link, another dropdown appears for them to select from the tags, and then save this to the Database as well. To me this seems like a highly advanced thing to accomplish, but to you guys this may be quite easy. Any tips, suggestions or links will be greatly appreciated. Thanks, Steve